Selenium unreachable browser exception, java socket exception

Recently, especially with several tasks and processes running on the same PC, selenium webdriver 2 gives many unreachable browser exceptions that always have a java socket exception:

 Exception in thread "main" org.openqa.selenium.remote.UnreachableBrowserException:                         Could not start a new session. Possible causes are invalid address of the remote server or     browser start-up failure.
   Build info: version: '2.25.0', revision: '17482', time: '2012-07-18 21:09:54'
  System info: os.name: 'Windows Vista', os.arch: 'x86', os.version: '6.0',       java.version: '1.7.0_05'
   Driver info: driver.version: FirefoxDriver
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:493)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:182)
at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:110)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:185)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:178)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:174)
at org.openqa.selenium.firefox.FirefoxDriver.<init>(FirefoxDriver.java:92)

    Caused by: java.net.SocketException: Permission denied: connect
at java.net.DualStackPlainSocketImpl.connect0(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.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:123)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:148)
at org.apache.http.impl.conn.AbstractPoolEntry.open(AbstractPoolEntry.java:150)
at org.apache.http.impl.conn.AbstractPooledConnAdapter.open(AbstractPooledConnAdapter.java:121)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:575)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:425)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:820)
at org.openqa.selenium.remote.HttpCommandExecutor.fallBackExecute(HttpCommandExecutor.java:319)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:297)
at org.openqa.selenium.firefox.internal.NewProfileExtensionConnection.execute(NewProfileExtensionConnection.java:136)
at org.openqa.selenium.firefox.FirefoxDriver$LazyCommandExecutor.execute(FirefoxDriver.java:357)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:472)
... 7 more

Why is this happening so often? Is selenim 2.25 incompatible with firefox 14?

+5
source share
4 answers

I also had the same issue with Selenium Web Driver. Especially when I run long test scripts without restarting the web driver. Then I switched to a new car with great performance, and then I could avoid almost 90%.

I assumed that this was due to lack of memory, and I updated my RAM to 4 GB on my new machine.

, .

: , , . - .

+1

, , , "UnreachableBrowserException".

.

System.setProperty("java.net.preferIPv4Stack" , "true");
+1

  • , .

  • - selenium FF, .

, selenium-server.jar libararies.

FF?

0

. .

  • Your browser instance is not closed properly. Thus, you can check with your task manager whether it kills the driver when calling the driver.close () method. I watched it mostly chrome and IE. For Firefox, it automatically closes the instance.

  • The version of FF and Webdriver must be compatible with each other. Change the Webdriver banks and try.

  • Your project may have an unwanted jar. Xalan.jar is what once helped me. Remove it and look.

0
source

All Articles