selenium 分布式 ,注册多个node到hub上

node机器中运行的代码

 

java -jar selenium-server-standalone-2.44.0.jar -role node  -hub http://{hub服务器地址}:4444/grid/register -port 5500 -maxSession 60 -browser "browserName=chrome,version=node_3,maxInstances=20,platform=WINDOWS" -Dwebdriver.chrome.driver="C:\\chromedriver.exe"

 

hub机器中运行的代码

 

java -jar selenium-server-standalone-2.44.0.jar -role hub

 

使用json配置node

java -jar selenium-server-standalone.jar -role node -nodeConfig nodeconfig.json

 

{
  "capabilities":
  [
    {
      "browserName": "firefox",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "chrome",
      "maxInstances": 5,
      "seleniumProtocol": "WebDriver"
    },
    {
      "browserName": "internet explorer",
      "maxInstances": 1,
      "seleniumProtocol": "WebDriver"
    }
  ],
  "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
  "maxSession": 5,
  "port": 5555,
  "register": true,
  "registerCycle": 5000,
  "hub": "http://localhost:4444",
  "nodeStatusCheckTimeout": 5000,
  "nodePolling": 5000,
  "role": "node",
  "unregisterIfStillDownAfter": 60000,
  "downPollingLimit": 2,
  "debug": false,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {}
}

 

使用json配置hub

java -jar selenium-server-standalone.jar -role hub -hubConfig hubconfig.json
{
  "port": 4444,
  "newSessionWaitTimeout": -1,
  "servlets" : [],
  "withoutServlets": [],
  "custom": {},
  "capabilityMatcher": "org.openqa.grid.internal.utils.DefaultCapabilityMatcher",
  "throwOnCapabilityNotPresent": true,
  "cleanUpCycle": 5000,
  "role": "hub",
  "debug": false,
  "browserTimeout": 0,
  "timeout": 1800
}

 

 

posted @ 2020-07-08 09:13  测试充电宝  阅读(824)  评论(0编辑  收藏  举报