Skip to content

fix: bidi error with webdriver #4850

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

Merged
merged 3 commits into from
Feb 12, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
973 changes: 454 additions & 519 deletions docs/helpers/WebDriver.md

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions lib/helper/WebDriver.js
Original file line number Diff line number Diff line change
@@ -35,6 +35,7 @@ let browserLogs = []
* @type {object}
* @prop {string} url - base url of website to be tested.
* @prop {string} browser - Browser in which to perform testing.
* @prop {boolean} [bidiProtocol=false] - WebDriver Bidi Protocol. Default: false. More info: https://webdriver.io/docs/api/webdriverBidi/
* @prop {string} [basicAuth] - (optional) the basic authentication to pass to base url. Example: {username: 'username', password: 'password'}
* @prop {string} [host=localhost] - WebDriver host to connect.
* @prop {number} [port=4444] - WebDriver port to connect.
@@ -488,6 +489,10 @@ class WebDriver extends Helper {
config.capabilities = config.desiredCapabilities
}
config.capabilities.browserName = config.browser || config.capabilities.browserName

// WebDriver Bidi Protocol. Default: false
config.capabilities.webSocketUrl = config.bidiProtocol ?? config.capabilities.webSocketUrl ?? true

config.capabilities.browserVersion = config.browserVersion || config.capabilities.browserVersion
if (config.capabilities.chromeOptions) {
config.capabilities['goog:chromeOptions'] = config.capabilities.chromeOptions