Selenium: 'UnreachableBrowserException: Error communicating with the remote browser. It may have died' when using ExpectedConditions

Created on 11 Jun 2018  Â·  5Comments  Â·  Source: SeleniumHQ/selenium

Meta -

OS: Linux
Selenium Version: 3.12.0
Browser: Chrome Driver 2.39
Browser Version: 67.0.3396.62

Expected Behaviour

When calling the following method:
public void fluentWaitForElementToBeStale(WebElement element) { FluentWait<WebDriver> wait = (new FluentWait<>(webdriver)).withTimeout(30, TimeUnit.SECONDS).pollingEvery(1, TimeUnit.MILLISECONDS).ignoring(TimeoutException.class); wait.until(ExpectedConditions.stalenessOf(element)); }
Like so:
fluentWaitForElementToBeStale(fluentWaitForElement(By.cssSelector("[id*=sys_group_grid][title='Enter Text to Filter on Group Name']")));
The code should run without error (as it did in previous versions of Selenium)

Actual Behavior -

On methods that use Expected Conditions, I'm seeing occasional errors as can be seen in the attached exception (with personal details removed)
Exception.txt
I don't see this in 3.7.0

Steps to reproduce

Create a series of Cucumber tests and add them to a Testng suite, run the suite in parallel with 5 threads

C-java D-chrome R-awaiting answer

All 5 comments

For issues please provide a concise reproducible test case and describe what results you are seeing and what results you expect.

See CONTRIBUTING.md

Extra details added, do you need anything else?

Please provide a concise reproducible test case, otherwise the issue will be closed.

Hello,

This issue must be opened.
it happens on Selenium 3.12.0 and chromedriverVersion: 2.39.562737.

Please see the stack trace:

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T14:04:26.12Z'
System info: host: '66b85223bbf1', ip: '172.17.0.2', os.name: 'Linux', os.arch: 'amd64', os.version: '4.14.42-52.37.amzn1.x86_64', java.version: '1.8.0_171'
Driver info: driver.version: RemoteWebDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.39.562737 (dba483cee6a5f1..., userDataDir: /tmp/.org.chromium.Chromium...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 67.0.3396.62, webStorageEnabled: true, webdriver.remote.sessionid: a80e8eb87bd380d94075d08a776...}
Session ID: a80e8eb87bd380d94075d08a776e2666
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:564)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at org.openqa.selenium.remote.RemoteWebElement.getText(RemoteWebElement.java:160)
at com.companyName.controlpaneltests.common.selenium.WebElementHelper.getTable(WebElementHelper.java:57)
at com.companyName.controlpaneltests.pagefactory.exchangeoperations.managedemandpartner.ManageDemandPartnersPage.checkIfThePreviousDSPIsInTheList(ManageDemandPartnersPage.java:212)
at com.companyName.controlpaneltests.steps.exchangeoperations.ManageDemandPartnersTest.checkIfTheTableContains(ManageDemandPartnersTest.java:162)
at ✽.I should see a row with the previous DSP added(/var/jenkins_home/sharedspace/companyName-2018_07_20_08_57_03_741/projects/controlpanel-tests/src/main/resources/features/exchangeoperations/ManageDemandPartners.feature:179)
Caused by: java.io.IOException: unexpected end of stream on Connection{xxx.xxx.xxx.xxx:4444, proxy=DIRECT hostAddress=/xxx.xxx.xxx.xxx::4444 cipherSuite=none protocol=http/1.1}
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:205)
at okhttp3.internal.http.CallServerInterceptor.intercept(CallServerInterceptor.java:88)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.connection.ConnectInterceptor.intercept(ConnectInterceptor.java:45)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.cache.CacheInterceptor.intercept(CacheInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.internal.http.BridgeInterceptor.intercept(BridgeInterceptor.java:93)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RetryAndFollowUpInterceptor.intercept(RetryAndFollowUpInterceptor.java:125)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:147)
at okhttp3.internal.http.RealInterceptorChain.proceed(RealInterceptorChain.java:121)
at okhttp3.RealCall.getResponseWithInterceptorChain(RealCall.java:200)
at okhttp3.RealCall.execute(RealCall.java:77)
at org.openqa.selenium.remote.internal.OkHttpClient.execute(OkHttpClient.java:105)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:155)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
at org.openqa.selenium.remote.RemoteWebElement.getText(RemoteWebElement.java:160)
at com.companyName.controlpaneltests.common.selenium.WebElementHelper.getTable(WebElementHelper.java:57)
at com.companyName.controlpaneltests.pagefactory.exchangeoperations.managedemandpartner.ManageDemandPartnersPage.checkIfThePreviousDSPIsInTheList(ManageDemandPartnersPage.java:212)
at com.companyName.controlpaneltests.steps.exchangeoperations.ManageDemandPartnersTest.checkIfTheTableContains(ManageDemandPartnersTest.java:162)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at cucumber.runtime.Utils$1.call(Utils.java:32)
at cucumber.runtime.Timeout.timeout(Timeout.java:16)
at cucumber.runtime.Utils.invoke(Utils.java:26)
at cucumber.runtime.java.JavaStepDefinition.execute(JavaStepDefinition.java:37)
at cucumber.runtime.StepDefinitionMatch.runStep(StepDefinitionMatch.java:40)
at cucumber.api.TestStep.executeStep(TestStep.java:102)
at cucumber.api.TestStep.run(TestStep.java:83)
at cucumber.api.TestCase.run(TestCase.java:58)
at cucumber.runner.Runner.runPickle(Runner.java:80)
at cucumber.api.testng.TestNGCucumberRunner.runScenario(TestNGCucumberRunner.java:84)
at cucumber.api.testng.AbstractTestNGCucumberTests.runScenario(AbstractTestNGCucumberTests.java:22)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:571)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:707)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:979)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.EOFException: \n not found: limit=0 content=…
at okio.RealBufferedSource.readUtf8LineStrict(RealBufferedSource.java:227)
at okhttp3.internal.http1.Http1Codec.readHeaderLine(Http1Codec.java:212)
at okhttp3.internal.http1.Http1Codec.readResponseHeaders(Http1Codec.java:189)
... 51 more

Was this page helpful?
0 / 5 - 0 ratings