webdriverio/webdriverio

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

Open

#14299 opened on Mar 18, 2025

View on GitHub
聽(4 comments)聽(1 reaction)聽(0 assignees)JavaScript聽(6,029 stars)聽(1,793 forks)batch import
Bug 馃悰help wanted

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