-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[py] Configure WebSocket timeout and wait interval via ClientConfig #16248
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[py] Configure WebSocket timeout and wait interval via ClientConfig #16248
Conversation
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||||||||
|
I think we should also add a test that actually modifies the timeout in addition to asserting default values test. |
|
sure... I'll add another test |
|
I added a test that uses the timeout. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
User description
🔗 Related Issues
#16270
💥 What does this PR do?
This PR allows the values for WebSocket timeout and wait interval to be set via the
ClientConfigclass in theselenium.webdriver.remote.client_configmodule.The class initializer is also where the default values are stored. Previously the values were set in private attributes in the
WebSocketConnectionclass and not easily configurable by the user.These settings are used for browser communication via WebSockets for both BiDi and CDP.
example usage:
setting the WebSocket timeout and wait interval on an existing local WebDriver:
starting a remote WebDriver using a custom
ClientConfigthat sets the WebSocket timeout and wait interval:🔗 Related Issues
Fixes #16260
🔧 Implementation Notes
This follows the implementation discussed in the 08/21/2025 Selenium TLC call.
🔄 Types of changes
PR Type
Enhancement
Description
Add WebSocket timeout and interval configuration to
ClientConfigUpdate
WebSocketConnectionto accept configurable timeout/interval parametersEnable WebSocket settings for both BiDi and CDP communication
Minor documentation formatting improvements
Diagram Walkthrough
File Walkthrough
client_config.py
Add WebSocket configuration propertiespy/selenium/webdriver/remote/client_config.py
websocket_timeoutandwebsocket_intervalproperties withdescriptors
defaults
webdriver.py
Pass WebSocket config to connectionspy/selenium/webdriver/remote/webdriver.py
start_devtools()to pass WebSocket config fromclient_config_start_bidi()to pass WebSocket config fromclient_configwebsocket_connection.py
Accept configurable timeout and intervalpy/selenium/webdriver/remote/websocket_connection.py