3

I'm running a bunch of test cases every hour using selenium-java 3.12.0; TestNG; Selenoid with docker, Jenkins. Sometimes (about 1 out of 10 cases) I get the error:

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'autotest.rvkernel.com', ip: '94.130.165.217', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-26-generic', java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
Capabilities [{mobileEmulationEnabled=false, hasTouchScreen=false, platform=LINUX, acceptSslCerts=false, acceptInsecureCerts=false, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, platformName=LINUX, setWindowRect=true, unexpectedAlertBehaviour=, applicationCacheEnabled=false, rotatable=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.39.562737 (dba483cee6a5f15e2e2d73df16968ab10b38a2bf), userDataDir=/tmp/.org.chromium.Chromium.gURWcu}, takesHeapSnapshot=true, pageLoadStrategy=normal, unhandledPromptBehavior=, databaseEnabled=false, handlesAlerts=true, version=67.0.3396.62, browserConnectionEnabled=false, nativeEvents=true, locationContextEnabled=true, cssSelectorsEnabled=true}]
Session ID: 56c4b100a95d89b3d5702ec8a1a0698a
    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.click(RemoteWebElement.java:83)
    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.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement$1.invoke(EventFiringWebDriver.java:376)
    at com.sun.proxy.$Proxy14.click(Unknown Source)
    at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:389)
    at com.Elements.Element.lambda$click$2(Element.java:99)
    at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
    at com.Elements.Element.click(Element.java:98)
    at com.Elements.Element.click(Element.java:78)
    at com.pages.landing.social.MailRuRegisterPage.clickRegister(MailRuRegisterPage.java:37)
    at RulVulaknTests.authorization.AuthorizationTest.authorizationUserFromMailRU(AuthorizationTest.java:100)
    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.lang.IllegalArgumentException: Cannot decode response content: 
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:83)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:44)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:543)
    ... 28 more
Caused by: org.openqa.selenium.json.JsonException: java.io.EOFException: End of input at line 1 column 1 path $
Build info: version: '3.6.0', revision: '6fbf3ec767', time: '2017-09-27T15:28:36.4Z'
System info: host: 'autotest.rvkernel.com', ip: '94.130.165.217', os.name: 'Linux', os.arch: 'amd64', os.version: '4.13.0-26-generic', java.version: '1.8.0_181'
Driver info: driver.version: RemoteWebDriver
    at org.openqa.selenium.json.JsonInput.execute(JsonInput.java:172)
    at org.openqa.selenium.json.JsonInput.peek(JsonInput.java:72)
    at org.openqa.selenium.json.JsonTypeCoercer.lambda$null$6(JsonTypeCoercer.java:136)
    at org.openqa.selenium.json.JsonTypeCoercer.coerce(JsonTypeCoercer.java:122)
    at org.openqa.selenium.json.Json.toType(Json.java:62)
    at org.openqa.selenium.json.Json.toType(Json.java:52)
    at org.openqa.selenium.remote.http.AbstractHttpResponseCodec.decode(AbstractHttpResponseCodec.java:80)
    ... 31 more
Caused by: java.io.EOFException: End of input at line 1 column 1 path $
    at com.google.gson.stream.JsonReader.nextNonWhitespace(JsonReader.java:1401)
    at com.google.gson.stream.JsonReader.consumeNonExecutePrefix(JsonReader.java:1576)
    at com.google.gson.stream.JsonReader.doPeek(JsonReader.java:534)
    at com.google.gson.stream.JsonReader.peek(JsonReader.java:425)
    at org.openqa.selenium.json.JsonInput.lambda$peek$0(JsonInput.java:73)
    at org.openqa.selenium.json.JsonInput.execute(JsonInput.java:168)
    ... 37 more

And after this error all remained tests are skipped.

Versions of chrome browser using which I have encountered the error - 66, 67.

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Alexei Paskhyn
  • 33
  • 1
  • 1
  • 4
  • Have you tried upgrading your Chrome Driver version? Latest is 2.41 – Squiggs. Aug 17 '18 at 11:24
  • @Squiggs chrome driver 2.38 is embedded in chrome 66 browser docker image, provided by Selenoid; and similarly 2.39 is embedded in chrome 67. so I haven't tried 2.41. – Alexei Paskhyn Aug 17 '18 at 12:26
  • Though you have removed the `` now but the trace log formats are broken now. Pretty tough to debug. Consider updating the question with fresh set of error trace logs. – undetected Selenium Aug 17 '18 at 12:59

2 Answers2

4

This error message...

org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.

...implies that the RemoteWebDriver instance was closed abruptly.

Your code trials would have been of some help to debug the issue. Perhaps yout main issue can be one of the following:

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • `Build info: version: '3.6.0'` - perhaps it is not about selenium version, cause I checked that there is only 1 selenium maven dependency in my project: ` org.seleniumhq.selenium selenium-java 3.12.0 ` – Alexei Paskhyn Aug 20 '18 at 10:43
0

sorry for the reply to very old questions, but thought it could help someone else. I was facing the same problem, and earlier I also thoughts issue is with Webdriver but it was not the case,

public static final Target EMAIL = Target.the("email")
    .locatedBy(("//input[(@id='login-email-input')]"));

And everything was working fine with,

actor.attemptsTo(Enter.keyValues("someemail@gmail.com")
    .into(EMAIL).thenHit(Keys.TAB));

but I thought to clear the input box before enter the new value and replaced above line with,

actor.attemptsTo(Clear.field(EMAIL));
actor.attemptsTo(Enter.keyValues("someemail@gmail.com")
   .into(EMAIL).thenHit(Keys.TAB));

And I got the same error. After removing newly added line, things started working correctly.

sama940
  • 35
  • 1
  • 5