testNG/selenium webdriver limited to 5 parallel tests

前端 未结 1 481
逝去的感伤
逝去的感伤 2021-01-22 11:03

I am running selenium webDriver with the maven surefire plugin and using testNG and have been able to parallelize my tests reusing one JVM instance. for some reason I am unsure

1条回答
  •  北海茫月
    2021-01-22 11:25

    If you are using a Selenium Grid, then it makes sense that your tests are being limited to 5 at a time. The factory Selenium Grid properties allow a grid to run:

    WebDriver: - 5 Google Chrome - 5 Firefox - 1 IE

    Legacy (RC): - 5 Google Chrome - 5 Firefox - 1 IE

    You can change these values using a node configuration json file.

    nodeConfig.json

    {
      "capabilities":
          [
            {
              "browserName": "*chrome",
              "maxInstances": 2,
              "seleniumProtocol": "Selenium"
            }
            ... (any other browser capabilities here)
          ],
      "configuration":
      {
        "proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
        "maxSession": 10,
        "port": 5555,
        "register": true,
        "registerCycle": 5000,
        "hubPort": 4444
      }
    }
    

    Then when running your nodes:

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

    0 讨论(0)
提交回复
热议问题