简体   繁体   English

Selenium Grid,并行运行多个浏览器实例

[英]Selenium Grid, running multiple browser instances in parallel

I'm using Selenium grid to run multiple instances of my test in parallel. 我正在使用Selenium网格并行运行测试的多个实例。 I want to test if I can run a lot of browsers at the same time. 我想测试是否可以同时运行许多浏览器。 My problem is that I can't have more that 5 five browsers at the same time, and I don't know why. 我的问题是我不能同时拥有五个以上的五个浏览器,而且我也不知道为什么。

Here are the commands I'm using to start the hub and the node: 这是我用来启动中心和节点的命令:

java -jar %seleniumPath% -port 4444 -role hub -nodeTimeout 1000

java -jar %seleniumPath% -role node -hub http://localhost:4444/grid/register -browser browserName=firefox,maxInstances=1,maxSession=1 -port 5555

NOTE: The two commands are working but what I don't understand are the maxInstances and the maxSession arguments. 注意:这两个命令正在工作,但是我不理解的是maxInstancesmaxSession参数。 I set them to 1 but I can still run more than one browser and if I set them to 10 or more only 5 browsers will run at the same time. 我将它们设置为1,但是我仍然可以运行多个浏览器,如果将它们设置为10或更多,则只能同时运行5个浏览器。

What should I do to have more than 5 browsers running at the same time? 要同时运行5个以上的浏览器,该怎么办?

Generally, according to Selenium Grid2 official documentation , -maxSession is the maximum number of browsers that can run in parallel on the node while -maxInstances sets how many instances of a particular browser can run simultaneously. 通常,根据Selenium Grid2官方文档-maxSession是可以在节点上并行运行的浏览器的最大数量,而-maxInstances设置特定浏览器可以同时运行的实例数量。

Don't forget to restart the local java process responsible for node session on each remote machine to apply these settings. 不要忘记在每个远程计算机上重新启动负责节点会话的本地Java进程,以应用这些设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM