Skip to content

CodeceptJS 3.7 + WebDriver 8 produce error 'Failed to execute WebDriver Bidi command "sessionSubscribe"' #4849

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

Closed
ngraf opened this issue Feb 11, 2025 · 2 comments · Fixed by #4850

Comments

@ngraf
Copy link
Contributor

ngraf commented Feb 11, 2025

Current state

Given you use CodeceptJS 3.7 and WebDriver 8+
When you run npx codeceptjs run
Then you will see an errror
'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'

Target state
The Bidi error does not occur.

Info

Image

@ngraf
Copy link
Contributor Author

ngraf commented Feb 11, 2025

I can confirm "3.7.2-beta.2" fixes the issue in the described case of https://github.com/ngraf/codeceptjs-examples/tree/bugfix/failed-to-execute-webdriver-bidi-command.

... but I am bit hesitant to say it will work in all cases.
When I use "3.7.2-beta.2" in my main complex test suite, the process hangs forever in a before hook.
✖ "before each" hook: codeceptjs.before for "My first Scenario"

Image

I cannot yet figure out if it the root cause is the code change in "3.7.2-beta.2" or if it is a fault in my test suite configuraiton. What I know is that "3.7.1" worked at least and did not hang in "before" hook. I try to dig deeper if I can find the cause.

My hottest guess right now is that issue is BiDi+Selenoid. Selenoid is my default place to run WebDriver tests. If I use local WebdriverIO, the test is green.
By the change
8c1017f
config.capabilities.webSocketUrl = config.webSocketUrl || config.capabilities.webSocketUrl || true
in "3.7.2-beta.2" you now have strengthen the support/integration of BiDi protocol? But Selenoid does not support BiDi at all. If this assumption is right, I wonder what has changed in 3.7.0 compared to 3.6.x that now BiDi got on the stage? Before in 3.6.5 I used also WebDriver 8.x and Selenoid with no issue. Now the issues started with 3.7.x.

@DavertMik
Copy link
Contributor

@ngraf could you get a stack trace on

✖ "before each" hook: codeceptjs.before for "My first Scenario"

Execute tests with --verbose flag

And check if there is stack trace

If nothing found run tests with DEBUG="codeceptjs:*"

And attach issue here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants