You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
Thanks for making this ticket, Corey. Reposting my use case from #15604 here in case it's helpful:
Occasionally, I deal with web pages that have absurdly long page generation times that I have no control over. By default, Selenium's read timeout is 120 seconds, which isn't always long enough.
Here's a Python function that I've been using to dynamically increase/decrease the timeout from 120 seconds to whatever amount of time I need:
My function works correctly, but throws a deprecation warning:
DeprecationWarning: set_timeout() in RemoteConnection is deprecated, set timeout to ClientConfig instance in constructor instead
The warning recommends changing the timeout value in the constructor, but for a true 1:1 replacement, we would need a simple way to change the timeout after the driver has already been created.
Description
There are many methods and attributes in the
RemoteConnection
class insidepy/selenium/webdriver/remote/remote_connection.py
that are marked as deprecated, and produce a warning like:However, AFAICT there is no way to pass a
ClientConfig
to any of the webdriver constructors exceptwebdriver.Remote
.On a remote WebDriver, you can do:
... 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 inClientConfig
after creating the driver.Possible Solution:
There is a
_client_config
attribute on theRemoteConnection
class. If we create aclient_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:
to summarize, I suggest we:
client_config
as a@property
that returnsself._client_config
Have you considered any alternatives or workarounds?
No response
The text was updated successfully, but these errors were encountered: