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

时间:2015-05-06 09:02:52

标签: selenium selenium-webdriver phantomjs selenium-grid

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

我将Selenium Grid与附加的PhantomJS作为WebDriver。 PhantoimJS exec命令:

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

1 个答案:

答案 0 :(得分:0)

我找到了解决方案。

这是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
}

所以我需要用params擦硒:

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

利润!