Random UnreachableBrowserException when running Selenium tests

I’m finding that, when running my selenium tests, I am getting errors in the console…..but these errors, confusingly don’t appear on every run. See below for a copy of the output:

“Started InternetExplorerDriver server (64-bit)
2.44.0.0
Listening on port 39496
Exception in thread “main” org.openqa.selenium.remote.UnreachableBrowserException: Error communicating with the remote browser. It may have died.
Build info: version: ‘2.43.1’, revision: ‘5163bce’, time: ‘2014-09-10 16:27:58′
System info: host: ‘MBD0150′, ip: ‘192.168.55.49’, os.name: ‘Windows 8.1′, os.arch: ‘amd64′, os.version: ‘6.3’, java.version: ‘1.8.0_25′
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:593)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:268)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:79)
at genericControls.contractFunctions.matchRequestTableContractSelectFunction(contractFunctions.java:150)
at Reports.collections.earlySettlementWorkflowFunctions(collections.java:94)
at Reports.programMain.main(programMain.java:44)
Caused by: org.openqa.selenium.WebDriverException: java.net.SocketException: Permission denied: connect
Build info: version: ‘2.43.1’, revision: ‘5163bce’, time: ‘2014-09-10 16:27:58′
System info: host: ‘MBD0150′, ip: ‘192.168.55.49’, os.name: ‘Windows 8.1′, os.arch: ‘amd64′, os.version: ‘6.3’, java.version: ‘1.8.0_25′
Driver info: driver.version: RemoteWebDriver
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:75)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:572)
… 5 more
Caused by: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:72)
at org.apache.http.impl.conn.HttpClientConnectionOperator.connect(HttpClientConnectionOperator.java:123)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:318)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:363)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:219)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:195)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:86)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:108)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:57)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:233)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:184)
at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:66)
… 6 more”*

I did a bit of research and, based on what I found, went to:
HKEY_LOCAL_MACHINE > SYSTEM > Services > Tcpip > Parameters

….and created a REG_DWORD with a name of ‘MaxUserPort’. I then set the value to ‘65534’. I chose this method as I was under the impression the issue is due to a new port opening each time I run a test using Internet Explorer driver. Unfortunately, doing this has not resolved the issue. I’ve not attached the code relating to the above error as I don’t think it’s relevant, in that the error will appear at different points of my test…..in some places where it has worked previously.

If anyone can help, that would be great.

tilston1001 Train Asked on December 18, 2014 in Selenium WebDriver.

Hi
Make Sure u are using the right Driver with correct version of  Selenium jar

on December 18, 2014.
Add Comment
1 Answer(s)

Hi ANdy,

Go to your Task Manager and switch off all the IE.exe process there and give it a try, or simple restart your machine and do a run again and see how it is doing.

Regards,
Lakshay Sharma

xLov3rDns Professor Answered on December 19, 2014.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.