UnreachableBrowserException in Selenium Webdriver 2.42.2 with PhantomJSDriver 1.1.0

596 Views Asked by At

I am doing a parallel execution of test cases using Selenium Web Driver 2.42.2 and Ghost Driver 1.1.0. The below exception occurs when more tests are being added. Initially, with less number of tests, I didn't see this exception.

Stack Trace:

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

Driver info: driver.version: RemoteWebDriver
    at java.net.PlainSocketImpl.socketConnect(Native Method)
    -----------------
    ---------------
    at org.openqa.selenium.remote.RemoteWebDriver.execute
    at org.openqa.selenium.remote.RemoteWebDriver.quit
1

There are 1 best solutions below

0
AlexM On

Try to look at memory consumption by phantomjs executable.

Seems to be the problem is in .get() method, which creates objects in PhantomJS memory time to time, without cleaning it