无法启动超过4个镀铬浏览器 - 硒网格
我使用以下来注册我的节点(与轮毂相同的机器):
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个浏览器。我是否缺少某种设置或在不知不觉中使用一些默认设置?请帮忙。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的, Selenium 3中有2个配置参数与您的问题相关:
例如,如果您想对Chrome和IE进行测试:
MaxSession = 10,则意味着在您的节点上,Chrome和IE只能运行10个会话。
,您可以在特定的浏览器设置命令中定义每种类型的每种类型的运行
数量
:
然后 在所有情况下。
默认情况下,我相信5岁,但是您可以通过将其添加到您的命令中来更改它:
解决方案:Java -dwebdriver.chrome.chrome.driver =< lt; chromedriver_path> 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个参数:
命令示例: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:
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:
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