无法启动超过4个镀铬浏览器 - 硒网格

发布于 2025-01-24 03:16:12 字数 343 浏览 1 评论 0 原文

我使用以下来注册我的节点(与轮毂相同的机器):

Java -dwebdriver.chrome.driver =< chromedriver_path> -jar selenium -server -standalone -3.9.1.1.jar -ol node -hub“ https:// localhost:4444/grid/grid/register/register/“ -browsern” -browsern'browsername = chrome = chrome,maxinstances = 10”

,但是当我执行测试时案例仅启动了4个浏览器。我是否缺少某种设置或在不知不觉中使用一些默认设置?请帮忙。

I using the following to register my node (same machine as the Hub):

java -Dwebdriver.chrome.driver = <chromedriver_path> -jar selenium-server-standalone-3.9.1.1.jar -role node -hub "https://localhost:4444/grid/register/" -browser "browserName=chrome,maxInstances=10"

But, when I execute the test cases only 4 browsers are launched. Is there a setting that I am missing or using some default setting unknowingly? Please help.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

熟人话多 2025-01-31 03:16:12

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

  • maxinstances:可以在节点上运行的相同类型的几个实例;
  • MaxSession:您可以在节点上运行的所有类型的会话。

例如,如果您想对Chrome和IE进行测试:

MaxSession = 10,则意味着在您的节点上,Chrome和IE只能运行10个会话。
,您可以在特定的浏览器设置命令中定义每种类型的每种类型的运行

数量

然后 在所有情况下。
默认情况下,我相信5岁,但是您可以通过将其添加到您的命令中来更改它:

解决方案:Java -dwebdriver.chrome.chrome.driver =&lt; lt; chromedriver_path&gt; gt; -jar selenium -server -standalone -3.9.1.1.jar -ol node -hub“ https:// localhost:4444/grid/grid/register/register/“ -browsern” -browsername“ browsername = chrome = chrome,maxinstances = 10” /strong>

来源:

对于 Selenium 4 ,您需要2个参数:

  • 一个覆盖默认的最大会话设置: - override-max-sessions true true
  • 一个来确定会话数量的数量您想要:-max-sessions 20

命令示例:java -jar selenium-server-server-4.0.0.0.0.0-3.jar节点 - detect-drivers true-max-sessions 20 - 跨越 - 莫克斯 - 梅克斯sessions true

Source Couses :
https://testingbootcamp.com/parallel-测试与 - 网格和融合有关的与Jenkins-9D959DDDBC1C
https://wwwww.selenium.dev/selenium.dev/documentation/documentation/grid/grid/configuration/configuration/toml_options/ < /a>

Yes, there are 2 configuration params in Selenium 3 related to your issue:

  • maxInstances: how many instances for the same type you can run on your node;
  • maxSession: how many sessions for all types you can run on your node.

For example, in case you want to run tests for Chrome and IE:

maxSession = 10 it means that on your node only 10 sessions from both Chrome and IE can run.
Then, you can define how many to run of each type, in the specific browser settings command:

-browser "browserName=chrome,maxInstances=6"

-browser "browserName=IE,maxInstances=4"

Hence, the maxSession is the total number of all instances.
By default, I belive is 5, but you can change it by adding this to your command:

SOLUTION: java -Dwebdriver.chrome.driver = <chromedriver_path> -jar selenium-server-standalone-3.9.1.1.jar -role node -hub "https://localhost:4444/grid/register/" -browser "browserName=chrome,maxInstances=10" –maxSession 10

Sources:

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

Selenium Grid: MaxSessions vs MaxInstances

For SELENIUM 4, it's a bit different as you need 2 parameters:

  • one to override the default max sessions setting: --override-max-sessions true
  • one to establish the number of sessions that you want: --max-sessions 20

Command example: java -jar selenium-server-4.0.0-rc-3.jar node --detect-drivers true --max-sessions 20 --override-max-sessions true

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文