无法启动超过4个chrome浏览器- Selenium Grid



我使用以下命令注册我的节点(与Hub相同的机器):

java -Dwebdriver.chrome。驱动=-jar selenium-server-standalone-3.9.1.1.jar -role node -hub "https://localhost:4444/grid/register/"浏览器"browserName = chrome, maxInstances = 10">

但是,当我执行测试用例时,只启动了4个浏览器。是否有我遗漏的设置或不知不觉地使用了一些默认设置?请帮助。

是的,在Selenium 3中有2个配置参数与您的问题相关:

  • maxInstances:你可以在你的节点上运行多少相同类型的实例;
  • maxSession:你可以在你的节点上运行的所有类型的会话数。

例如,如果您想运行Chrome和IE的测试:

maxSession= 10这意味着在你的节点上只有10个会话从Chrome和IE可以运行。然后,您可以在特定的浏览器设置命令

中定义每种类型运行的数量:浏览器"browserName = chrome, maxInstances = 6">

浏览器"browserName = IE, maxInstances = 4">

因此,maxSession是所有实例的总数。默认情况下,我认为是5,但您可以通过将此添加到命令中来更改它:

<<p>解决方案/strong>: java -Dwebdriver.chrome。驱动=-jar selenium-server-standalone-3.9.1.1.jar -role node -hub "https://localhost:4444/grid/register/"浏览器"browserName = chrome, maxInstances = 10";-maxSession 10

来源:

https://www.softwaretestinghelp.com/selenium-grid-selenium-tutorial-29/maxSession

Selenium Grid: MaxSessions vs MaxInstances

ForSELENIUM 4,它有点不同,因为你需要两个参数:

  • 一个覆盖默认的最大会话设置:——overrides -max-sessions true
  • ——max-sessions 20

命令示例:java -jar selenium-server-4.0.0-rc-3.jar node——detect-drivers true——max-sessions 20——overrides -max-sessions true

来源:https://testingbootcamp.com/parallel-testing-with-selenium-grid-and-integration-with-jenkins-9d959dddbc1chttps://www.selenium.dev/documentation/grid/configuration/toml_options/https://webelement.click/en/selenium_grid_4_complete_guide_to_configuration_flags _override_max_sessions

最新更新