Search code examples
seleniumselenium-webdriverphantomjsselenium-grid

PhantomJS WebDriver timeout (access via Selenium Grid)


I need to set (descrease) PhantomJS timeout: 300000 (300sec) -> 30000 (30sec)

I have Selenium Grid with attached PhantomJS as WebDriver. PhantoimJS exec command:

phantomjs --config=phantomjs.json --webdriver=6661  --webdriver-selenium-grid-hub=http://127.0.0.1:4440

Content of phantomjs.json (i add random values for test):

{
    "resourceTimeout": 123456,
    "timeout": 345678,
    "wait": 234567    
}

But in Selenium grid shows timeout: 300000

Screenshot: https://i.sstatic.net/hPwBQ.png


Solution

  • I found a solution.

    Here is config for selenium grid (hub.json):

    {
      "host": null,
      "port": 4440,
      "newSessionWaitTimeout": -1,
      "servlets" : [],
      "prioritizer": null,
      "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
      "throwOnCapabilityNotPresent": true,
      "nodePolling": 5000,
      "cleanUpCycle": 5000,
      "timeout": 60000,
      "browserTimeout": 60000,
      "maxSession": 25,
      "maxInstances": 25,
      "jettyMaxThreads":-1
    }
    

    So i need to rub selenium with params:

    java -jar selenium-server-standalone-2.45.0.jar -role hub -hubConfig hub.json
    

    The profit!