Discussion:
[chromium-discuss] How to fix issue"org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died."
li zs
2018-06-27 11:44:03 UTC
Permalink
Today i encouter an issue,
After selenium driver connect to a remote selenium hub, if let driver wait
more than 30 seconds(not take any actions for driver),
then if executing "driver.getPageSource()" or "((TakesScreenshot)
seleniumDriver).getScreenshotAs(OutputType.FILE);", it will throw an error
*"org.openqa.selenium.remote.UnreachableBrowserException: Error
communicating with the remote browser. It may have died."*

code looks like:
*sleep(31);*
*final File screenshotFile = ((TakesScreenshot)
seleniumDriver).getScreenshotAs(OutputType.FILE);*

If i add one findElement action,
*sleep(31);*
*seleniumDriver.findElement(By.xpath("//div"));*
*final File screenshotFile = ((TakesScreenshot)
seleniumDriver).getScreenshotAs(OutputType.FILE);*

The above error will disappear. i think this could be a work around method
to fix the issue. But How to really fix this issue?

my java code using Selenium version 3.12.0,
remote hub start with command:
START /B java -jar selenium-server-standalone-3.6.0.jar -role hub -port
4444 -timeout 30000 >hub.txt 2>&1
START /B java -Dwebdriver.server.session.timeout=30000 -jar
selenium-server-standalone-3.6.0.jar -role node -hub
http://10.182.12.241:4444/grid/register -maxSession 50 -browser
"browserName=chrome,maxInstances=50" -port 6666
--
--
Chromium Discussion mailing list: chromium-***@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
You received this message because you are subscribed to the Google Groups "Chromium-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discuss+***@chromium.org.
Loading...