且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Selenium Grid:MaxSessions与MaxInstances

更新时间:2023-09-01 10:36:16

很好的问题....我会说这有点令人困惑....但是会尝试用简单的方式回答..

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 这表示....一次可以在一个浏览器中并行运行多少个浏览器(任何浏览器和任何版本).远程系统.因此,这会覆盖最大实例数"设置,并会限制可以并行运行的浏览器实例的数量.

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.

Irrespective of what MaxInstances you have defined.

有关更清晰的信息,请访问- https://seleniumhq.github.io/docs/grid .html

For more clear info do visit - https://seleniumhq.github.io/docs/grid.html