Selenium Grid:MaxSessions 与 MaxInstances [英] Selenium Grid: MaxSessions vs MaxInstances
问题描述
我想知道是否有人可以解释一个让我们有点头疼的 Selenium
问题.
I was wondering if anybody could shed some light on a Selenium
question that has been giving us a bit of head scratching.
我们对Selenium Grid的MaxSession
和MaxInstances
的含义感到困惑.我们认为 MaxSession
是可以在单个节点上运行的测试会话总数.而且我们还认为 MaxInstances
是测试可以打开的浏览器总数.
We're confused on meaning of MaxSession
and MaxInstances
of Selenium Grid. We think that the MaxSession
is the total number of test sessions that can run on a single node. And we also think that the MaxInstances
is the total number of browsers that a test can open.
或者MaxInstances
是节点可用的浏览器总数?
Or is MaxInstances
the total number of browsers available to the node?
我们使用的命令是:
java -Xrs -jar selenium-server.jar -role node -port 44506 -hub http://localhost:44500
/grid/register -firefoxProfileTemplate SeleniumProfile -timeout 300000 -browser
"browserName=firefox,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver" -browser
"browserName=chrome,maxInstances=10,platform=ANY,seleniumProtocol=WebDriver"
我们认为我们使用节点的方式(上图)默认是 5 个并发测试会话.
We think the way we are using our node (above) is 5 concurrent test sessions by default.
每个测试是否有 20 个浏览器可用?
或者每个测试会话是否与其他测试会话共享池中的 20 个浏览器(10 chrome/10 FF)?
推荐答案
好问题....我会说这有点令人困惑....但会尽量用简单的术语回答..
Nice question....i would say it's bit confusing.... But will try to answer it in simple terms..
MaxInstances 这表示....有多少相同版本浏览器的实例可以在远程系统上运行.
MaxInstances This says....how many instances of same version of browser can run over the Remote System.
For example, i have a FF12,IE and i declared the command as follows
-browser browserName=firefox,version=12,maxInstances=5,platform=LINUX
-browser browserName=InternetExplorer,version=9.0,maxInstances=5,platform=LINUX
所以我可以在远程机器上同时运行 5 个 Firefox 12 实例和 5 个 IE9 实例.因此,总用户可以并行运行 10 个不同浏览器(FF12 和 IE9)的实例.
So i can run 5 instances of Firefox 12 and as well as 5 instances of IE9 at the same time in remote machine. So total user can run 10 instances of different browsers (FF12 & IE9) in parallel.
MaxSession 这表示....有多少浏览器(任何浏览器和任何版本)可以在同一时间并行运行远程系统.所以这会覆盖 Max Instances 设置,并且可以限制可以并行运行的浏览器实例的数量.
MaxSession This says....how many browsers (Any Browser and any version) can run in parallel at a time in the remote system. So this overrides the Max Instances settings and can restrict the number of browser instances that can run in parallel.
For above example, when maxSession=1 forces that you never have more than 1 browser running.
With maxSession=2 you can have 2 Firefox tests at the same time, or 1 Internet Explorer and 1 Firefox test).
无论您定义了什么 MaxInstances.
要获得更清晰的信息,请访问 - https://seleniumhq.github.io/docs/grid.html
For more clear info do visit - https://seleniumhq.github.io/docs/grid.html
这篇关于Selenium Grid:MaxSessions 与 MaxInstances的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!