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

时间:2022-01-13 01:51:07

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

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

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

我有Selenium Grid,附加了PhantomJS作为WebDriver。 PhantoimJS exec命令:

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):

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

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

But in Selenium grid shows timeout: 300000

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

Screenshot: http://i.stack.imgur.com/hPwBQ.png

1 个解决方案

#1


I found a solution.

我找到了解决方案。

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

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

所以我需要用params擦硒:

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

The profit!

#1


I found a solution.

我找到了解决方案。

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

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

所以我需要用params擦硒:

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

The profit!