-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
Description
Description
There are many methods and attributes in the RemoteConnection class inside py/selenium/webdriver/remote/remote_connection.py that are marked as deprecated, and produce a warning like:
"DeprecationWarning: set_timeout() in RemoteConnection is deprecated, set timeout to ClientConfig instance in constructor instead."
However, AFAICT there is no way to pass a ClientConfig to any of the webdriver constructors except webdriver.Remote.
On a remote WebDriver, you can do:
from selenium import webdriver
from selenium.webdriver.remote.client_config import ClientConfig
client_config = ClientConfig(remote_server_addr="http://localhost:4444", timeout=10)
options = webdriver.ChromeOptions()
driver = webdriver.Remote(options=options, client_config=client_config)
... which is pretty ugly. Local webdrivers don't accept a client_config argument, so this doesn't work for them. The other drawback of setting it in the constructor is that it doesn't allow you to change any settings in ClientConfig after creating the driver.
Possible Solution:
There is a _client_config attribute on the RemoteConnection class. If we create a client_config property, it would be part of the public API and allow you to set attributes on it after driver creation.
You could do this:
driver.command_executor.client_config.timeout = 10
to summarize, I suggest we:
- add
client_configas a@propertythat returnsself._client_config - update all the deprecation messages to suggest using this instead of what they say now
Have you considered any alternatives or workarounds?
No response