Selenium Grid cannot forward the request Connect to node

2.3k views Asked by At

I am having a real hard time setting Selenium Grid. The configuration looks like this:

  1. Hub - windows 7 machine
  2. Chrome on windows node - same windows 7 machine
  3. Firefox on windows node - same windows 7 machine
  4. ie on windows node - same windows 7 machine
  5. Chrome on Linux node - VM running inside same windows 7 machine
  6. Firefox on Linux node - VM running inside same windows 7 machine
  7. Chrome on mac node - mac mini
  8. Firefox on mac node - same mac mini
  9. Safari on mac node - same mac mini
  10. Web app server - VM running inside same windows 7 machine

I have a 150 tests test suite and I am trying to run all tests on all nodes in parallel. Tests run on mac mini almost never come to the end. I am getting the same error message for all three browsers and it happens without any pattern. The error might occur during any of tests. It happens even if I am running tests only in one browser on the mac mini. The problem never occurs on windows or Linux nodes.

Error message:

org.openqa.selenium.WebDriverException: cannot forward the request Connect
to 192.168.1.103:5555 [/192.168.1.103] failed: Connection timed out: connect
Command duration or timeout: 21.02 seconds
Build info: version: '2.45.0', revision: '5017cb8', time: '2015-02-26 23:59:50'
System info: host: 'hub', ip: '192.168.56.1', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_45'
Driver info: org.openqa.selenium.remote.RemoteWebDriver
Capabilities [{applicationCacheEnabled=true, rotatable=false, handlesAlerts=true, databaseEnabled=true, version=38.0.5, platform=MAC, nativeEvents=false, acceptSslCerts=true, webdriver.remote.sessionid=1f7a9512-5c5b-4f52-bcd9-ca4d8f351343, webStorageEnabled=true, locationContextEnabled=true, browserName=firefox, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 1f7a9512-5c5b-4f52-bcd9-ca4d8f351343
*** Element info: {Using=xpath, value=(//*[contains(concat(' ', normalize-space(@class), ' '), ' explorerWidget ')]//*[contains(concat(' ', normalize-space(@class), ' '), ' controlContentRow ')])[2]//a}
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:204)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:156)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:599)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:352)
at org.openqa.selenium.remote.RemoteWebDriver.findElementByXPath(RemoteWebDriver.java:449)
at org.openqa.selenium.By$ByXPath.findElement(By.java:357)
at org.openqa.selenium.remote.RemoteWebDriver.findElement(RemoteWebDriver.java:344)
at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.openqa.selenium.support.ThreadGuard$WebDriverInvocationHandler.invokeUnderlying(ThreadGuard.java:100)
at org.openqa.selenium.support.ThreadGuard$WebDriverInvocationHandler.invoke(ThreadGuard.java:92)
at com.sun.proxy.$Proxy9.findElement(Unknown Source)
at org.openqa.selenium.support.ui.ExpectedConditions.findElement(ExpectedConditions.java:730)
at org.openqa.selenium.support.ui.ExpectedConditions.access$0(ExpectedConditions.java:728)
at org.openqa.selenium.support.ui.ExpectedConditions$3.apply(ExpectedConditions.java:106)
at org.openqa.selenium.support.ui.ExpectedConditions$3.apply(ExpectedConditions.java:1)
at org.openqa.selenium.support.ui.FluentWait.until(FluentWait.java:208)
at com.altego.common.WebElements.getElementByXpath(WebElements.java:31)
at com.altego.webactions.View.setView(View.java:41)
at com.altego.tests.functional.DistributionViewTest.DDistributionMeasure(DistributionViewTest.java:172)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:84)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:714)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111)
at org.testng.TestRunner.privateRun(TestRunner.java:767)
at org.testng.TestRunner.run(TestRunner.java:617)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.access$000(SuiteRunner.java:37)
at org.testng.SuiteRunner$SuiteWorker.run(SuiteRunner.java:368)
at org.testng.internal.thread.ThreadUtil$2.call(ThreadUtil.java:64)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: org.openqa.grid.common.exception.GridException: cannot forward the request Connect to 192.168.1.103:5555 [/192.168.1.103] failed: Connection timed out: connect
at org.openqa.grid.web.servlet.handler.RequestHandler.process(RequestHandler.java:139)
at org.openqa.grid.web.servlet.DriverServlet.process(DriverServlet.java:83)
at org.openqa.grid.web.servlet.DriverServlet.doPost(DriverServlet.java:67)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.seleniumhq.jetty7.servlet.ServletHolder.handle(ServletHolder.java:565)
at org.seleniumhq.jetty7.servlet.ServletHandler.doHandle(ServletHandler.java:479)
at org.seleniumhq.jetty7.server.session.SessionHandler.doHandle(SessionHandler.java:225)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doHandle(ContextHandler.java:1031)
at org.seleniumhq.jetty7.servlet.ServletHandler.doScope(ServletHandler.java:406)
at org.seleniumhq.jetty7.server.session.SessionHandler.doScope(SessionHandler.java:186)
at org.seleniumhq.jetty7.server.handler.ContextHandler.doScope(ContextHandler.java:965)
at org.seleniumhq.jetty7.server.handler.ScopedHandler.handle(ScopedHandler.java:117)
at org.seleniumhq.jetty7.server.handler.HandlerWrapper.handle(HandlerWrapper.java:111)
at org.seleniumhq.jetty7.server.Server.handle(Server.java:349)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.handleRequest(AbstractHttpConnection.java:452)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handleRequest(BlockingHttpConnection.java:47)
at org.seleniumhq.jetty7.server.AbstractHttpConnection.content(AbstractHttpConnection.java:894)
at org.seleniumhq.jetty7.server.AbstractHttpConnection$RequestHandler.content(AbstractHttpConnection.java:948)
at org.seleniumhq.jetty7.http.HttpParser.parseNext(HttpParser.java:857)
at org.seleniumhq.jetty7.http.HttpParser.parseAvailable(HttpParser.java:235)
at org.seleniumhq.jetty7.server.BlockingHttpConnection.handle(BlockingHttpConnection.java:66)
at org.seleniumhq.jetty7.server.bio.SocketConnector$ConnectorEndPoint.run(SocketConnector.java:254)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:599)
at org.seleniumhq.jetty7.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:534)
at java.lang.Thread.run(Unknown Source)

I am not sure that makes much sense of putting code here since error could occur in any test, but I can leave my hubConfig.json and nodeConfig.json.

hubConfig.json

{
  "host": null,
  "port": 4444,
  "newSessionWaitTimeout": 20000,
  "servlets" : ["org.openqa.grid.web.servlets.ResourceServlet"],
  "prioritizer": null,
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "nodePolling": 5000,

  "cleanUpCycle": 500000,
  "timeout": 3000000,
  "browserTimeout": 500000,
  "maxSession": 10,
  "jettyMaxThreads":-1

} 

nodeConfig.json:

{
 "capabilities":
      [
        {
          "browserName": "firefox",
          "maxInstances": 1
        }
      ],
"configuration":
    {
    "nodeTimeout":600000,
    "port":5555,

    "nodePolling":5000,

    "registerCycle":10000,
    "register":true,
    "cleanUpCycle":200000,
    "timeout":600000,
    "maxSession":1
    }
}

Another thing that might be useful, both machines are connected to router using wireless connection.

Thanks

0

There are 0 answers