Skip to content

[πŸ› Bug]: Cannot open Chrome session with incognito mode along with Bidi CDPΒ #14518

@datxhoang

Description

@datxhoang

What happened?

I would like to open Google Chrome session as incognito mode with Bidi CDP but the Chrome window created then disappear right after then throw the error.
I am using:

  • Java 17
  • Selenium 4.22.0

Just write the simple unit test then you can see the issue.

How can we reproduce the issue?

@Test
    public void test() throws Exception {
        ChromeOptions chromeOptions = new ChromeOptions();
        chromeOptions.addArguments("incognito");
        chromeOptions.setCapability("webSocketUrl", true);
        
        WebDriver webDriver = new CChromeDriver(chromeOptions, 0);
        webDriver.get("https://google.com");
    }

Relevant log output

org.openqa.selenium.SessionNotCreatedException: Could not start a new session. Response code 500. Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Failed to open new tab - no browser is open"}
  (Session info: chrome=128.0.6613.138) 
Host info: host: 'Dats-MacBook-Pro.local', ip: 'fe80:0:0:0:4c2:77b4:a52b:f70c%en0'
Build info: version: '4.22.0', revision: 'c5f3146703'
System info: os.name: 'Mac OS X', os.arch: 'aarch64', os.version: '14.5', java.version: '17.0.10'
Driver info: com.demo.selenium.driver.CChromeDriver
Command: [null, newSession {capabilities=[Capabilities {browserName: chrome, goog:chromeOptions: {args: [incognito], binary: /Applications/Google Chrome..., extensions: []}, webSocketUrl: true}]}]
  at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:114)
  at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:75)
  at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:61)
  at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:162)
  at org.openqa.selenium.remote.service.DriverCommandExecutor.invokeExecute(DriverCommandExecutor.java:216)
  at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:174)
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:518)
  at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:232)
  at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:161)
  at org.openqa.selenium.chromium.ChromiumDriver.<init>(ChromiumDriver.java:114)
  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:88)
  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:83)
  at org.openqa.selenium.chrome.ChromeDriver.<init>(ChromeDriver.java:72)

Operating System

MacOS

Selenium version

4.22.0

What are the browser(s) and version(s) where you see this issue?

Chrome 128

What are the browser driver(s) and version(s) where you see this issue?

ChromeDriver 128

Are you using Selenium Grid?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    G-chromedriverRequires fixes in ChromeDriver

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions