我的硒网格配置有什么问题? [英] What is wrong with my selenium grid configuration?

查看:31
本文介绍了我的硒网格配置有什么问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用硒网格来实现功能测试,我将其与testNG结合在一起以同时运行多个测试.当我运行testNG时,firefox开始执行selenium脚本,但是问题是我不能同时拥有5个以上的浏览器,而且我也不知道为什么.这是我启动集线器和节点的方法.

中心:

启动java -jar%seleniumPath%-端口4444-角色集线器-nodeTimeout 1000

节点:

启动java -jar%seleniumPath%-角色节点-hub

解决方案

通常,maxSessions会覆盖maxInstances.maxInstances定义您可以在selenium节点上增加特定浏览器的实例数量.

maxSessions定义了总会话数,包括我们可以在selenium节点上运行的所有浏览器.

因此maxSessions是所有浏览器的累积属性.例如,如果您为firefox设置了maxInstances = 2,为chrome设置了maxInstances = 2,则意味着您一次最多可以运行2个Firefox和2个chrome,但是如果您同时配置了maxSessions = 3,则可以旋转一次最多只能建立3个工作阶段,可能是2 FF,1 Chrome,1 FF,2 chrome.

如果您运行: java -jar selenium-server.jar-角色节点-h 它会显示节点角色的所有可能选项,您可以在其中找到:-maxSession:可以在节点上同时运行的最大测试数量,独立于所使用的浏览器.

最后,如果maxSessions<[所有浏览器的maxInstances],maxSessions将被赋予优先级这就是为什么如果将maxInstances设置为100、200却将maxSessions设置为1的原因,那么它将在控制台中仅显示1

I'm using selenium grid to realize functional testing, i combine it with testNG to run multiple test at the same time. When i run testNG, firefox start execute the selenium script, but the problem is that i can't have more than 5 browser at the same time and i don't know why. Here is the way i start the hub and the node.

The hub :

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

The node :

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

The way i understand it, i should be able to have only 1 firefox browser opened at a time. But whatever the number is, the maxInstnaces and maxSession options seems to be ignored and the number of browser simultaneously running remains 5 or less.

This is a screenshot of my grid console which show how much instance this node could handle at the same time. When i put a high number like 100 or 200, i have the corresponding incons.

解决方案

Generally maxSessions overrides the maxInstances. maxInstances defines how many instances of a particular browser you can spin up on the selenium node.

maxSessions defines how many total sessions including all the browsers we can run on selenium node.

so maxSessions is cumulative property for all the browsers. for example if you have set maxInstances=2 for firefox, maxInstances=2 for chrome, it means at max you can run 2 firefox and 2 chromes at a time, but on the same time if you have configured maxSessions=3 then you can spin up only 3 sessions at a time, which may be 2 FF, 1 Chrome, 1 FF, 2 chrome.

If you run : java -jar selenium-server.jar -role node -h It will show all possible options for node role there you can find : -maxSession: max number of tests that can run at the same time on the node, independently of the browser used.

At last, if maxSessions < [maxInstances for all the browsers], maxSessions will be given priority And thats why if you set maxInstances to even 100, 200 but keep maxSessions to 1 it will show only 1 in the console

这篇关于我的硒网格配置有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆