selenium.webdriver.remote.remote_connection#

Classes

RemoteConnection([remote_server_addr, ...])

A connection with the Remote WebDriver server.

class RemoteConnection(remote_server_addr=None, keep_alive=True, ignore_proxy=False, ignore_certificates=False, init_args_for_pool_manager=None, client_config=None)[source]#

Bases: object

A connection with the Remote WebDriver server.

Communicates with the server using the WebDriver wire protocol: SeleniumHQ/selenium

Parameters:
  • remote_server_addr (str | None)

  • keep_alive (bool)

  • ignore_proxy (bool)

  • ignore_certificates (bool | None)

  • init_args_for_pool_manager (dict | None)

  • client_config (ClientConfig | None)

browser_name: str | None = None#
os = <module 'os' from '/home/runner/.bazel/execroot/_main/external/rules_python++python+python_3_10_19_x86_64-unknown-linux-gnu/lib/python3.10/os.py'>#
socket = <module 'socket' from '/home/runner/.bazel/execroot/_main/external/rules_python++python+python_3_10_19_x86_64-unknown-linux-gnu/lib/python3.10/socket.py'>#
certifi = <module 'certifi' from '/home/runner/.bazel/sandbox/processwrapper-sandbox/155/execroot/_main/bazel-out/local_linux_gnu-opt-exec/bin/py/sphinx-build.runfiles/rules_python++pip+py_dev_requirements_310_certifi/site-packages/certifi/__init__.py'>#
system = 'linux'#
extra_headers = None#
user_agent = 'selenium/4.48.0 (python linux)'#
property client_config#
classmethod get_timeout()[source]#

Returns timeout value in seconds for all http requests made to the Remote Connection.

Returns:

Timeout value in seconds for all http requests made to the Remote Connection

classmethod set_timeout(timeout)[source]#

Override the default timeout.

Parameters:

timeout – timeout value for http requests in seconds

classmethod reset_timeout()[source]#

Reset the http request timeout to socket._GLOBAL_DEFAULT_TIMEOUT.

classmethod get_certificate_bundle_path()[source]#

Returns paths of the .pem encoded certificate to verify connection to command executor.

Returns:

Paths of the .pem encoded certificate to verify connection to command executor. Defaults to certifi.where() or REQUESTS_CA_BUNDLE env variable if set.

classmethod set_certificate_bundle_path(path)[source]#

Set the path to the certificate bundle for verifying command executor connection.

Can also be set to None to disable certificate validation.

Parameters:

path – path of a .pem encoded certificate chain.

classmethod get_remote_connection_headers(parsed_url, keep_alive=False)[source]#

Get headers for remote request.

Parameters:
  • parsed_url – The parsed url

  • keep_alive – Is this a keep-alive connection (default: False)

extra_commands: dict[str, str] = {}#
add_command(name, method, url)[source]#

Register a new command.

get_command(name)[source]#

Retrieve a command if it exists.

Parameters:

name (str)

execute(command, params)[source]#

Send a command to the remote server.

Any path substitutions required for the URL mapped to the command should be included in the command parameters.

Parameters:
  • command – A string specifying the command to execute.

  • params – A dictionary of named parameters to send with the command as its JSON payload.

close()[source]#

Clean up resources when finished with the remote_connection.