-5

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.

Andy Tilston
  • 227
  • 1
  • 5
  • 18

1 Answers1

2

I faced the same issue in past after upgrading Service pack it was resolved. But also suggest you to look at the below.

  • Check your network settings (firewall, proxy, antivirus software) to find the cause of "Permission denied: connect"
  • Find out it is windows 7's problem, upgrade to SP1 the problem solved.
  • Seems when running web-driver, it will open many many TCP ports and exhaust the available ports, then throw this exception. Check Selenium Version if older then 2.44 then try upgrading to 2.44 and see what happens.
  • Running the following command, killed all running IEDriverServer.exe processes, taskkill /F /IM IEDriverServer.exe
Rupesh Shinde
  • 1,933
  • 12
  • 22