PhantomJS WebDriver 超时(通过 Selenium Grid 访问)

PhantomJS WebDriver timeout (access via Selenium Grid)

我需要设置(减少)PhantomJS 超时:300000(300 秒)-> 30000(30 秒)

我有 Selenium Grid,附带 PhantomJS 作为 WebDriver。 PhantoimJS 执行命令:

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

phantomjs.json的内容(我添加随机值进行测试):

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

但在 Selenium 网格中显示 超时:300000

截图: http://i.stack.imgur.com/hPwBQ.png

我找到了解决办法。

这是 selenium 网格 (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
}

所以我需要用参数摩擦 selenium:

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

盈利!