-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
[java] Add web socket timeout for java binding #16410
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
base: trunk
Are you sure you want to change the base?
[java] Add web socket timeout for java binding #16410
Conversation
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
PR Code Suggestions ✨Explore these optional code suggestions:
|
based on the test in python implementation i added properties with duration seconds and milliseconds
should it be both of milliseconds ? |
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.
We need to keep these parameters contained to the client config class. The BiDi spec doesn't manage any timeouts, so we don't need to have options that get sent to the browser, and we don't want the driver juggling this directly.
Check out #13190 where we create a BiDi command executor to manage all of this. I'm not sure how close to ready that PR is I haven't looked at it in a while, but we actually want to pull this code out of the individual drivers.
In Python, both values are in seconds. (defaults are
In Python, we have Here is an example of instantiating a
|
We need to get the ClientConfig all they way down to the drivers. I would like to avoid this approach. |
User description
🔗 Related Issues
fixes #16270
💥 What does this PR do?
This pull request adds support for configuring WebSocket timeout and interval settings for BiDi (Bidirectional) connections in both Chromium and Firefox drivers. It introduces new options in
ChromiumOptions
andFirefoxOptions
to allow users to customize these settings, and propagates these configurations through the driver and HTTP client layers. The changes also ensure these settings are merged and exported as capabilities, making them available throughout the driver lifecycle.🔧 Implementation Notes
WebSocket Timeout and Interval Configuration Support
Added
webSocketTimeout
andwebSocketInterval
fields, along with corresponding setter and getter methods, to bothChromiumOptions
andFirefoxOptions
, allowing users to customize WebSocket communication timing. These are also included in the set of extra capability names and exported as capabilities (se:webSocketTimeout
andse:webSocketInterval
).Updated the constructors of
ChromiumDriver
andFirefoxDriver
to extract the new WebSocket timeout and interval capabilities and pass them to the BiDi connection logic, ensuring the driver uses the configured values.Modified the
createBiDi
methods in both drivers to accept and use the WebSocket timeout and interval values when creating the WebSocket client configuration.HTTP Client Configuration Enhancements
ClientConfig
to supportwebSocketTimeout
andwebSocketInterval
fields, with associated builder methods and propagation through all configuration methods. Updated default values and ensured these settings are applied when constructing HTTP clients for WebSocket communication.Other Minor Updates
Duration
in relevant files. [💡 Additional Considerations
🔄 Types of changes
PR Type
Enhancement
Description
Add WebSocket timeout and interval configuration support for BiDi connections in Java bindings
Extend
ChromiumOptions
andFirefoxOptions
with WebSocket timing setters/getters and capability exportPropagate WebSocket configuration through driver constructors and HTTP client layers
Update
ClientConfig
andJdkHttpClient
to support and apply WebSocket timeout/interval settingsDiagram Walkthrough
File Walkthrough
ChromiumDriver.java
Extract and apply WebSocket configuration in ChromiumDriver
java/src/org/openqa/selenium/chromium/ChromiumDriver.java
values
createBiDi
methodClientConfig
ChromiumOptions.java
Add WebSocket configuration fields and capabilities to ChromiumOptions
java/src/org/openqa/selenium/chromium/ChromiumOptions.java
webSocketTimeout
andwebSocketInterval
fields with default valuesse:webSocketTimeout
andse:webSocketInterval
capabilitiesmergeInPlace
methodFirefoxDriver.java
Extract and apply WebSocket configuration in FirefoxDriver
java/src/org/openqa/selenium/firefox/FirefoxDriver.java
createBiDi
methodClientConfig
with WebSocket timeout and interval for BiDiconnection
FirefoxOptions.java
Add WebSocket configuration fields and capabilities to FirefoxOptions
java/src/org/openqa/selenium/firefox/FirefoxOptions.java
webSocketTimeout
andwebSocketInterval
fields with default valuesgetExtraCapability
getExtraCapabilityNames
ClientConfig.java
Extend ClientConfig with WebSocket timeout and interval support
java/src/org/openqa/selenium/remote/http/ClientConfig.java
webSocketTimeout
andwebSocketInterval
fields to configurationJdkHttpClient.java
Apply WebSocket timeout configuration in JdkHttpClient
java/src/org/openqa/selenium/remote/http/jdk/JdkHttpClient.java
webSocketTimeout
andwebSocketInterval
fields fromClientConfig
webSocketTimeout
instead ofreadTimeout
for WebSocket operationsmessage sending