-
-
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
ChromiumOptionsandFirefoxOptionsto 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
webSocketTimeoutandwebSocketIntervalfields, along with corresponding setter and getter methods, to bothChromiumOptionsandFirefoxOptions, allowing users to customize WebSocket communication timing. These are also included in the set of extra capability names and exported as capabilities (se:webSocketTimeoutandse:webSocketInterval).Updated the constructors of
ChromiumDriverandFirefoxDriverto 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
createBiDimethods in both drivers to accept and use the WebSocket timeout and interval values when creating the WebSocket client configuration.HTTP Client Configuration Enhancements
ClientConfigto supportwebSocketTimeoutandwebSocketIntervalfields, 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
Durationin 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
ChromiumOptionsandFirefoxOptionswith WebSocket timing setters/getters and capability exportPropagate WebSocket configuration through driver constructors and HTTP client layers
Update
ClientConfigandJdkHttpClientto support and apply WebSocket timeout/interval settingsDiagram Walkthrough
File Walkthrough
ChromiumDriver.java
Extract and apply WebSocket configuration in ChromiumDriverjava/src/org/openqa/selenium/chromium/ChromiumDriver.java
values
createBiDimethodClientConfigChromiumOptions.java
Add WebSocket configuration fields and capabilities to ChromiumOptionsjava/src/org/openqa/selenium/chromium/ChromiumOptions.java
webSocketTimeoutandwebSocketIntervalfields with default valuesse:webSocketTimeoutandse:webSocketIntervalcapabilitiesmergeInPlacemethodFirefoxDriver.java
Extract and apply WebSocket configuration in FirefoxDriverjava/src/org/openqa/selenium/firefox/FirefoxDriver.java
createBiDimethodClientConfigwith WebSocket timeout and interval for BiDiconnection
FirefoxOptions.java
Add WebSocket configuration fields and capabilities to FirefoxOptionsjava/src/org/openqa/selenium/firefox/FirefoxOptions.java
webSocketTimeoutandwebSocketIntervalfields with default valuesgetExtraCapabilitygetExtraCapabilityNamesClientConfig.java
Extend ClientConfig with WebSocket timeout and interval supportjava/src/org/openqa/selenium/remote/http/ClientConfig.java
webSocketTimeoutandwebSocketIntervalfields to configurationJdkHttpClient.java
Apply WebSocket timeout configuration in JdkHttpClientjava/src/org/openqa/selenium/remote/http/jdk/JdkHttpClient.java
webSocketTimeoutandwebSocketIntervalfields fromClientConfigwebSocketTimeoutinstead ofreadTimeoutfor WebSocket operationsmessage sending