Skip to content

[🐛 Bug]: [bidi] Chrome is closing after opening Developer Tools #15679

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

Open
Zlaman opened this issue Apr 29, 2025 · 2 comments
Open

[🐛 Bug]: [bidi] Chrome is closing after opening Developer Tools #15679

Zlaman opened this issue Apr 29, 2025 · 2 comments
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-devtools Includes everything BiDi or Chrome DevTools related C-java Java Bindings D-chrome I-defect Something is not working as intended OS-windows

Comments

@Zlaman
Copy link

Zlaman commented Apr 29, 2025

Description

  1. Run below code with breakpoint on System.out.println
  2. Open Developer Tools in Chrome
    Browser gets closed automatically

It is reproducing with/without Selenium Grid, on Windows and Mac.
Using Chrome version 136.0.7103.49
If options.enableBiDi(); is commented, issue is not reproducing.
If

driver.switchTo().window(newWindowHandle).close();
driver.switchTo().window(currentWindowHandle);

is commented, issue is not reproducing with BiDi enabled.
Once driver.switchTo().window(newWindowHandle).close(); is executed, opening Developer Tools will cause browser to close.

Reproducible Code

ChromeOptions options = new ChromeOptions();
options.enableBiDi();
WebDriver driver = new ChromeDriver(options);
driver.get("https://www.selenium.dev");
WebElement element = driver.findElement(By.cssSelector("[href='https://opencollective.com/selenium']"));
new Actions(driver).scrollToElement(element).perform();
element.click();
String currentWindowHandle = driver.getWindowHandle();
String newWindowHandle = driver.getWindowHandles().stream()
          .filter(handle -> !handle.equals(currentWindowHandle)).findFirst().get();
driver.switchTo().window(newWindowHandle).close();
driver.switchTo().window(currentWindowHandle);
System.out.println("Put breakpoint here and open Dev Tools in browser, browser will close");

Debugging Logs

https://gist.github.com/Zlaman/62c3c6ca9cecb9514e5e2ebc71a10bf1
@Zlaman Zlaman added A-needs-triaging A Selenium member will evaluate this soon! I-defect Something is not working as intended labels Apr 29, 2025
@selenium-ci
Copy link
Member

@Zlaman, thank you for creating this issue. We will troubleshoot it as soon as we can.

Selenium Triage Team: remember to follow the Triage Guide

@titusfortner titusfortner added the B-devtools Includes everything BiDi or Chrome DevTools related label Apr 29, 2025
@yi0n
Copy link

yi0n commented May 6, 2025

I tried to connect to a local running Chrome instance over 127.0.0.1:9222 without success.
Chrome Version: 136.0.7103.49
Selenium Version: 4.32.0
Error message:

selenium.common.exceptions.SessionNotCreatedException: Message: session not created: cannot connect to chrome at 127.0.0
.1:9222
from chrome not reachable
Stacktrace:
GetHandleVerifier [0x00007FF6DFA1A145+76773]
GetHandleVerifier [0x00007FF6DFA1A1A0+76864]
(No symbol) [0x00007FF6DF7D8DAC]
(No symbol) [0x00007FF6DF7C9BE1]
(No symbol) [0x00007FF6DF81C082]
(No symbol) [0x00007FF6DF81126E]
(No symbol) [0x00007FF6DF865155]
(No symbol) [0x00007FF6DF864710]
(No symbol) [0x00007FF6DF857133]
(No symbol) [0x00007FF6DF8204D1]
(No symbol) [0x00007FF6DF821263]
GetHandleVerifier [0x00007FF6DFCDA8ED+2962317]
GetHandleVerifier [0x00007FF6DFCD4EC2+2939234]
GetHandleVerifier [0x00007FF6DFCF2FF3+3062419]
GetHandleVerifier [0x00007FF6DFA34B9A+185914]
GetHandleVerifier [0x00007FF6DFA3C78F+217647]
GetHandleVerifier [0x00007FF6DFA22A44+111844]
GetHandleVerifier [0x00007FF6DFA22BF2+112274]
GetHandleVerifier [0x00007FF6DFA08A79+5401]
BaseThreadInitThunk [0x00007FFC753F84D4+20]
RtlUserThreadStart [0x00007FFC75C61A11+33]

It looks like the Chrome update has broken the connection to the driver again, as it happend some weeks ago.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-needs-triaging A Selenium member will evaluate this soon! B-devtools Includes everything BiDi or Chrome DevTools related C-java Java Bindings D-chrome I-defect Something is not working as intended OS-windows
Projects
None yet
Development

No branches or pull requests

4 participants