Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

bugfix: prevent this error when running WebDriver without Bidi protocol: 'Error: Failed to execute WebDriver Bidi command "sessionSubscribe"' #5095

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

Open
ngraf wants to merge 3 commits into codeceptjs:3.x
base: 3.x
Choose a base branch
Loading
from ngraf:bugfix/do-not-run-sessionSubscribe-when-bidi-protocol-is-inactive
Open
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
9 changes: 6 additions & 3 deletions lib/helper/WebDriver.js
View file Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ class WebDriver extends Helper {
}
config.capabilities.browserName = config.browser || config.capabilities.browserName

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

config.capabilities.browserVersion = config.browserVersion || config.capabilities.browserVersion
Expand Down Expand Up @@ -629,8 +629,11 @@ class WebDriver extends Helper {

this.browser.on('dialog', () => {})

await this.browser.sessionSubscribe({ events: ['log.entryAdded'] })
this.browser.on('log.entryAdded', logEvents)
// Check for Bidi, because "sessionSubscribe" is an exclusive Bidi protocol feature. Otherwise, error will be thrown.
if (this.browser.capabilities && this.browser.capabilities.webSocketUrl) {
await this.browser.sessionSubscribe({ events: ['log.entryAdded'] })
this.browser.on('log.entryAdded', logEvents)
}

return this.browser
}
Expand Down
Loading

AltStyle γ«γ‚ˆγ£γ¦ε€‰ζ›γ•γ‚ŒγŸγƒšγƒΌγ‚Έ (->γ‚ͺγƒͺγ‚ΈγƒŠγƒ«) /