webdriverio / webdriverio/webdriverio

[🐛 Bug]: While using getpuppeteer in firefox it report reach maximum session

Open
#14,299 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Bug 🐛 help wanted
Dominant language
TypeScript
Stars
9.8k
Forks
2.7k
Avg merge
2d 13h
Merged PRs (30d)
69

Description

Have you read the Contributing Guidelines on issues?
WebdriverIO Version

9.5.7

Node.js Version

22.0.0

Mode

WDIO Testrunner

Which capabilities are you using?
{
        maxInstances: 5,
        browserName: 'firefox',
        webSocketUrl: true,
        'moz:debuggerAddress': true,
        'moz:firefoxOptions': {
            binary,
            args: [
                // '--headless',
                '--width',
                '1500',
                '--height',
                '1000',
            ],
            prefs: {
                'browser.download.folderList': 2,
                'browser.download.dir': `${downloadPath}`,
                'browser.download.panel.shown': true,
                'browser.download.useDownloadDir': true,
            },
        }
What happened?

when I use getPuppeteer in firefox the default is

Image

which cause the connection goes to _connectToCdpBrowser in puppeteer under firefox.
Then I specified the protocol to "webDriverBiDi" and use browserWSEndpoint: this.capabilities.webSocketUrl,

Image
it connected and the session.status is success. but it reported error blow when puppeteer try to session.new:

ProtocolError: Protocol error (session.new): session not created Maximum number of active sessions RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[firefox 128.8.0 windows #0-0] ProtocolError: Protocol error (session.new): session not created Maximum number of active sessions RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[firefox 128.8.0 windows #0-0] WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
[firefox 128.8.0 windows #0-0] SessionNotCreatedError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:709:5
[firefox 128.8.0 windows #0-0] createSession@chrome://remote/content/webdriver-bidi/WebDriverBiDi.sys.mjs:119:13
[firefox 128.8.0 windows #0-0] onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:188:55
[firefox 128.8.0 windows #0-0] onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
[firefox 128.8.0 windows #0-0] handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14

Does it support to use puppeteer under firefox in Webdriverio?
Same error when I specified the protocol to "webDriverBiDi" and use browserWSEndpoint: this.capabilities.webSocketUrl in Chrome.

What is your expected behavior?

Could successfully use puppeteer

How to reproduce the bug.

Official demo use bidi and set getPuppeteer like this.
Image

Relevant log output
_ProtocolError: Protocol error (session.new): session not created Maximum number of active sessions RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[firefox 128.8.0 windows #0-0] ProtocolError: Protocol error (session.new): session not created Maximum number of active sessions RemoteError@chrome://remote/content/shared/RemoteError.sys.mjs:8:8
[firefox 128.8.0 windows #0-0] WebDriverError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:193:5
[firefox 128.8.0 windows #0-0] SessionNotCreatedError@chrome://remote/content/shared/webdriver/Errors.sys.mjs:709:5
[firefox 128.8.0 windows #0-0] createSession@chrome://remote/content/webdriver-bidi/WebDriverBiDi.sys.mjs:119:13
[firefox 128.8.0 windows #0-0] onPacket@chrome://remote/content/webdriver-bidi/WebDriverBiDiConnection.sys.mjs:188:55
[firefox 128.8.0 windows #0-0] onMessage@chrome://remote/content/server/WebSocketTransport.sys.mjs:127:18
[firefox 128.8.0 windows #0-0] handleEvent@chrome://remote/content/server/WebSocketTransport.sys.mjs:109:14_
Code of Conduct
  • I agree to follow this project's Code of Conduct
Is there an existing issue for this?
  • I have searched the existing issues

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing getPuppeteer with protocol set to webDriverBiDi and browserWSEndpoint set from capabilities.webSocketUrl. Compare the _connectToCdpBrowser path with the WebDriver BiDi session.new request, using the provided Firefox and Chrome configurations to reproduce the failure. Done means Puppeteer connects successfully without the maximum active sessions error.

Written by the indexing model from the issue text.

Assessment

Tech stack
node.js, typescript
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.