selenium 4.27.0 - Error communicating with the remote browser. It may have died.

285 views
Skip to first unread message

lz5vj4sw8s

unread,
Jan 21, 2025, 9:35:44 AM1/21/25
to ChromeDriver Users
I get the following error in the middle of the test run. My application has constantly opened 2 tabs, sometimes3 tabs - maybe chromedriver memory is too small ?

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '4.27.0', revision: 'd6e718d134'
System info: os.name: 'Linux', os.arch: 'amd64', os.version: '4.18.0-553.34.1.el8_10.x86_64', java.version: '17.0.13'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Command: [c1c8de5870026bc469a9c4b1d3ac57d6, getCurrentUrl []]
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 131.0.6778.264, chrome: {chromedriverVersion: 131.0.6778.264 (2d05e315153..., userDataDir: /tmp/.org.chromium.Chromium...}, fedcm:accounts: true, goog:chromeOptions: {debuggerAddress: localhost:37215}, networkConnectionEnabled: false, pageLoadStrategy: normal, platformName: linux, proxy: Proxy(), se:cdp: ws://localhost:37215/devtoo..., se:cdpVersion: 131.0.6778.264, setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:extension:minPinLength: true, webauthn:extension:prf: true, webauthn:virtualAuthenticators: true}
Session ID: c1c8de5870026bc469a9c4b1d3ac57d6
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:618)
  at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:622)
  at org.openqa.selenium.remote.RemoteWebDriver.getCurrentUrl(RemoteWebDriver.java:325)
  at com.company.framework.pages.HomePage.startNewHomePage(HomePage.java:167)
  at bddSteps.home.HomePageSteps.iOpenHomePage(HomePageSteps.java:41)
  at ✽.I open home page page(file:///home/jenkins-slave/workspace/company/src/test/java/bddFeatures/homePage/FormTool.feature:7)
Caused by: java.io.UncheckedIOException: java.net.ConnectException
  at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:496)
  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.lambda$executeAsync$1(JdkHttpClient.java:383)
  at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:539)
  at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
  at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
  at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
  at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.net.ConnectException
  at java.net.http/jdk.internal.net.http.HttpClientImpl.send(HttpClientImpl.java:574)
  at java.net.http/jdk.internal.net.http.HttpClientFacade.send(HttpClientFacade.java:123)
  at org.openqa.selenium.remote.http.jdk.JdkHttpClient.execute0(JdkHttpClient.java:455)
  ... 8 more
Caused by: java.net.ConnectException
  at java.net.http/jdk.internal.net.http.common.Utils.toConnectException(Utils.java:1083)
  at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:198)
  at java.net.http/jdk.internal.net.http.PlainHttpConnection.checkRetryConnect(PlainHttpConnection.java:230)
  at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$1(PlainHttpConnection.java:206)
  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:195)
  at java.base/sun.nio.ch.SocketChannelImpl.beginConnect(SocketChannelImpl.java:760)
  at java.base/sun.nio.ch.SocketChannelImpl.connect(SocketChannelImpl.java:848)
  at java.net.http/jdk.internal.net.http.PlainHttpConnection.lambda$connectAsync$0(PlainHttpConnection.java:183)
  at java.base/java.security.AccessController.doPrivileged(AccessController.java:569)
  at java.net.http/jdk.internal.net.http.PlainHttpConnection.connectAsync(PlainHttpConnection.java:185)
  ... 9 more

Sahitya Kokkula

unread,
Jan 23, 2025, 2:27:05 AM1/23/25
to ChromeDriver Users

If you're facing the "Error communicating with the remote browser. It may have died" issue in Selenium 4.27.0, this error usually occurs due to compatibility or environment setup issues. Here’s how to resolve it:

  1. Check WebDriver and Browser Compatibility: Ensure that your Selenium version and the browser driver (e.g., ChromeDriver for Chrome) are both updated and compatible with the browser version you're using.

  2. Update Your Selenium Version: Sometimes, upgrading to the latest version of Selenium can fix known bugs. You can upgrade Selenium by running pip install --upgrade selenium if you are using Python.

  3. Ensure Proper Timeout Settings: The error may occur if the browser takes too long to respond. Increase the timeout settings in your Selenium script, such as driver.set_page_load_timeout(60).

  4. Check for Browser or WebDriver Crashes: Restart the browser and WebDriver to clear any existing sessions that may have been disrupted.

  5. Check System Resources: If your system is low on resources (CPU, memory), the browser may crash. Make sure there are enough system resources available for Selenium to run smoothly.

By following these steps, you can overcome the "Error communicating with the remote browser" issue and continue your learning process in Selenium automation testing. For a more comprehensive understanding, consider enrolling in a Selenium course for beginners, which provides in-depth knowledge and practical experience to troubleshoot such errors and much more.

Reply all
Reply to author
Forward
0 new messages