Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[🐛 Bug]: Chrome driver 133.0.6943.98 switching windows and closing windows generates unknow expection #15299

Open
eliira71 opened this issue Feb 18, 2025 · 9 comments

Comments

@eliira71
Copy link

What happened?

Google chrome updated to 133.0.6943.99
So I update chrome driver to chromedriver-win64_133.0.6943.98
Now this call to wait for a second window generates a Timeout Exception.
The browser does open a new tab with the expected results but Selenium does not see it and generates a timeout.

WebDriverWait(driver, 20).until(EC.number_of_windows_to_be(2))
generates TimeoutException with no msg.

Only thing that changed was an update to chrome and the chrome web driver.

How can we reproduce the issue?

need a site that opens another tab/window.  
Call
WebDriverWait(driver, 20).until(EC.number_of_windows_to_be(2))

Relevant log output

No log Just timeout exception.

Operating System

Windows 11

Selenium version

Pyhton 3.10.2 Selenium version: 3.141.0

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

Chrome 133.0.6943.99

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

chromedriver-win64_133.0.6943.98

Are you using Selenium Grid?

Yes, but duplicated results with and with out grid.

Copy link

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


Info for maintainers

Triage this issue by using labels.

If information is missing, add a helpful comment and then I-issue-template label.

If the issue is a question, add the I-question label.

If the issue is valid but there is no time to troubleshoot it, consider adding the help wanted label.

If the issue requires changes or fixes from an external project (e.g., ChromeDriver, GeckoDriver, MSEdgeDriver, W3C), add the applicable G-* label, and it will provide the correct link and auto-close the issue.

After troubleshooting the issue, please add the R-awaiting answer label.

Thank you!

@demnik
Copy link

demnik commented Feb 19, 2025

I also get an error when closing one of the tabs and switching to the main tab after updating Chrome from version 132 to 133.
I'm using Selenium Grid. And when switching between tabs there is an error which is shown in the Selenium Node console

java.io.UncheckedIOException: java.net.ConnectException
        at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:458)
        at org.openqa.selenium.remote.http.AddSeleniumUserAgent.lambda$apply$0(AddSeleniumUserAgent.java:42)
        at org.openqa.selenium.remote.http.Filter.lambda$andFinally$1(Filter.java:55)
        at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute(JdkHttpClient.java:374)
        at org.openqa.selenium.remote.tracing.TracedHttpClient.execute(TracedHttpClient.java:54)
        at org.openqa.selenium.grid.web.ReverseProxyHandler.execute(ReverseProxyHandler.java:90)
        at org.openqa.selenium.grid.node.DefaultActiveSession.execute(DefaultActiveSession.java:62)
        at org.openqa.selenium.grid.node.local.SessionSlot.execute(SessionSlot.java:126)
        at org.openqa.selenium.grid.node.local.LocalNode.stopTimedOutSession(LocalNode.java:312)
        at com.google.common.cache.LocalCache.processPendingNotifications(LocalCache.java:1849)
        at com.google.common.cache.LocalCache$Segment.runUnlockedCleanup(LocalCache.java:3506)
        at com.google.common.cache.LocalCache$Segment.cleanUp(LocalCache.java:3488)
        at com.google.common.cache.LocalCache.cleanUp(LocalCache.java:3953)
        at com.google.common.cache.LocalCache$LocalManualCache.cleanUp(LocalCache.java:4961)
        at org.openqa.selenium.concurrent.GuardedRunnable.lambda$guard$0(GuardedRunnable.java:35)
        at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
        at java.base/java.util.concurrent.FutureTask.runAndReset(FutureTask.java:358)
        at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305)
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
        at java.base/java.lang.Thread.run(Thread.java:1570)
Caused by: java.net.ConnectException
        at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1065)
        at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:227)
        at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:280)
        at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$2(PlainHttpConnection.java:238)
        at java.base/java.util.concurrent.CompletableFuture.uniHandle(CompletableFuture.java:934)
        at java.base/java.util.concurrent.CompletableFuture$UniHandle.tryFire(CompletableFuture.java:911)
        at java.base/java.util.concurrent.CompletableFuture.postComplete(CompletableFuture.java:510)
        at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1773)
        ... 3 more
Caused by: java.nio.channels.ClosedChannelException
        at java.base/sun.nio.ch.SocketChannelImpl.ensureOpen(SocketChannelImpl.java:204)
        at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:873)
        at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:961)
        at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:210)
        at java.base/java.security.AccessController.doPrivileged(AccessController.java:571)
        at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:212)
        ... 9 more

at the moment I have
chromedriver 133.0.6943.9800
chrome version 133.0.6943.127
selenium grid 4.25.0

@pujagani
Copy link
Contributor

Can you please provide a reproducible test script? Also, does this also happen with Firefox? I think this can be a Chrome-specific issue but just want to confirm that. Thank you!

@demnik
Copy link

demnik commented Feb 19, 2025

Can you please provide a reproducible test script? Also, does this also happen with Firefox? I think this can be a Chrome-specific issue but just want to confirm that. Thank you!

Sorry, I cannot attach my test script because it is too tied to my test project, which is highly nested. But in my test case, an action occurs, after which a new tab opens and switches to it. Next, the action takes place in the new tab after which the tab closes automatically. At this point this error occurs. The error occurs only with the Google Chrome browser, it does not exist in Firefox

@nirtal85
Copy link

I wrote an article to mitigate this issue: https://www.linkedin.com/pulse/test-automation-best-practices-pinning-browser-version-nir-tal-b5b8f/

@eliira71
Copy link
Author

Issue seems to be chrome specific. Same workflow works fine with Microsoft edge.

@demnik
Copy link

demnik commented Feb 21, 2025

I wrote an article to mitigate this issue: https://www.linkedin.com/pulse/test-automation-best-practices-pinning-browser-version-nir-tal-b5b8f/

Thanks for the article! But unfortunately it is not suitable for me since I need to test on the latest versions of chrome

@navin772
Copy link
Member

This seems related to #15318, there's a chromedriver issue opened - issues.chromium.org/issues/396611138 for the same.

@user93485938459
Copy link

user93485938459 commented Feb 21, 2025

I get WebDriverException with chrome 133 (have to downgrade to 132...)

This occurs when I get driver.WindowHandles.Count and when I switch window. Works fine in 132. Has been driving me mad for the past 2-3 weeks. Thought the new selenium version 4.29.0 would fix it, but no luck.

OpenQA.Selenium.WebDriverException: 'An unknown exception was encountered sending an HTTP request to the remote WebDriver server for URL http://localhost:56483/session/fa6f1ad1d57bb1ef5fc9060fd540420d/window/handles. The exception message was: No connection could be made because the target machine actively refused it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

6 participants