问题描述
我正在使用硒网格来实现功能测试,我将其与testNG结合在一起以同时运行多个测试.当我运行testNG时,firefox开始执行selenium脚本,但是问题是我不能同时拥有5个以上的浏览器,而且我也不知道为什么.这是我启动集线器和节点的方法.
中心:
节点:
The node :
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 priorityAnd thats why if you set maxInstances to even 100, 200 but keep maxSessions to 1 it will show only 1 in the console
这篇关于我的硒网格配置有什么问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!