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
Changing several connection.execute to connection.send when we want it to be blocking.
Use env.builder() instead of new Builder() so it uses the bazel configured values for the run
I removed firefox options tests that I don't think work any more
💡 Additional Considerations
More tests to follow up, just need to get things fixed first.
PR Type
Bug fix, Tests
Description
Replace deprecated connection.execute() calls with connection.send()
Simplify CDP connection method signatures by removing null parameters
Remove flaky Firefox WebExtension profile tests from test suite
Re-enable JavaScript tests on RBE by fixing test compatibility issues
Diagram Walkthrough
flowchart LR
A["CDP Connection Calls"] -->|Replace execute with send| B["Simplified Method Signatures"]
C["Firefox Options Tests"] -->|Remove WebExtension tests| D["Stable Test Suite"]
E["Test Configuration"] -->|Re-enable on RBE| F["Passing JS Tests"]
B --> F
D --> F
Loading
File Walkthrough
Relevant files
Bug fix
webdriver.js
Refactor CDP connection method calls
javascript/selenium-webdriver/lib/webdriver.js
Replace connection.execute() with connection.send() for CDP commands
Remove three JavaScript test entries from skip list (test-builder-test.js-chrome, test-chrome-devtools-test.js-chrome, test-firefox-options-test.js-firefox)
Re-enable previously skipped JavaScript tests on RBE
Generic: Robust Error Handling and Edge Case Management
Objective: Ensure comprehensive error handling that provides meaningful context and graceful degradation
Status: Unhandled CDP failures: Newly added connection.send(...) calls are awaited without local error handling or contextual error enrichment, so CDP enable/evaluate failures may surface without actionable context depending on upstream handling.
Referred Code
awaitconnection.send('Fetch.enable',{handleAuthRequests: true,})awaitconnection.send('Network.setCacheDisabled',{cacheDisabled: true,})}/** * Handle Network interception requests * @param connection WebSocket connection to the browser * @param httpResponse Object representing what we are intercepting * as well as what should be returned. * @param callback callback called when we intercept requests. */asynconIntercept(connection,httpResponse,callback){this._cdpWsConnection.on('message',(message)=>{constparams=JSON.parse(message)if(params.method==='Fetch.requestPaused'){constrequestPausedParams=params['params']if(requestPausedParams.request.url==httpResponse.urlToIntercept){
... (clipped193lines)
Add the await keyword when calling the asynchronous createCDPConnection function to ensure the connection variable receives the resolved value, not a Promise.
if (script.handle in this.pinnedScripts_) {
let connection
if (Object.is(this._cdpConnection, undefined)) {
- connection = this.createCDPConnection('page')+ connection = await this.createCDPConnection('page')
} else {
connection = this._cdpConnection
}
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 9
__
Why: This suggestion correctly identifies a missing await for the asynchronous createCDPConnection call within the unpinScript method, which would cause a runtime error.
High
Use send for CDP event commands
Replace connection.execute with connection.send for CDP commands inside the register method's event handler to align with the ongoing refactoring.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 8
__
Why: This suggestion correctly points out that connection.execute calls were missed during the refactoring to connection.send within the register method, which would likely cause a runtime error.
Medium
Learned best practice
Clean up temporary test resources
Ensure the temp profile directory is removed even if the test fails by adding an after hook (or try/finally) that recursively deletes profileWithUserPrefs.
[To ensure code accuracy, apply this suggestion manually]
Suggestion importance[1-10]: 5
__
Why:
Relevant best practice - In tests that create external resources (temporary directories/profiles), always clean them up in a finally/after hook so failures don’t leak resources.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
User description
💥 What does this PR do?
connection.executetoconnection.sendwhen we want it to be blocking.env.builder()instead ofnew Builder()so it uses the bazel configured values for the run💡 Additional Considerations
More tests to follow up, just need to get things fixed first.
PR Type
Bug fix, Tests
Description
Replace deprecated
connection.execute()calls withconnection.send()Simplify CDP connection method signatures by removing null parameters
Remove flaky Firefox WebExtension profile tests from test suite
Re-enable JavaScript tests on RBE by fixing test compatibility issues
Diagram Walkthrough
File Walkthrough
webdriver.js
Refactor CDP connection method callsjavascript/selenium-webdriver/lib/webdriver.js
connection.execute()withconnection.send()for CDP commandsNetwork.setCacheDisabled, Page.enable, Runtime.evaluate,
Page.removeScriptToEvaluateOnLoad)
script handling
builder_test.js
Simplify builder test setupjavascript/selenium-webdriver/test/builder_test.js
env.builder()helper methodoptions_test.js
Remove flaky WebExtension testsjavascript/selenium-webdriver/test/firefox/options_test.js
verifyUserAgent()helper function
.skipped-tests
Re-enable JavaScript tests on RBE.skipped-tests
(test-builder-test.js-chrome, test-chrome-devtools-test.js-chrome,
test-firefox-options-test.js-firefox)