Skip to content

Commit a4c2c03

Browse files
committed
bugfix: prevent error 'Error: Failed to execute WebDriver Bidi command "sessionSubscribe" as no Bidi session was established. Make sure you enable it by setting "webSocketUrl: true" in your capabilities and verify that your environment and browser supports it.' being printed to stdout when user deactivated Bidi protocol with "bidiProtocol" : false in Webdriver config.
1 parent 1e3f15c commit a4c2c03

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/helper/WebDriver.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -632,10 +632,9 @@ class WebDriver extends Helper {
632632
// Check for Bidi, because "sessionSubscribe" is an exclusive Bidi protocol feature. Otherwise, error will be thrown.
633633
if (this.browser.capabilities && this.browser.capabilities.webSocketUrl) {
634634
await this.browser.sessionSubscribe({ events: ['log.entryAdded'] })
635+
this.browser.on('log.entryAdded', logEvents)
635636
}
636637

637-
this.browser.on('log.entryAdded', logEvents)
638-
639638
return this.browser
640639
}
641640

0 commit comments

Comments
 (0)