0

I am new to selenium grid. So can someone please explain me the difference between the maxSession and maxInstances. And also how many parallel browsers can be used in one node?

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
Kartik
  • 83
  • 9

1 Answers1

0

As per the documentation by default, starting a Selenium Grid Node allows for concurrent use of 11 browsers, comprising of 5 Firefox, 5 Chrome and 1 Internet Explorer browser.

The maximum number of concurrent tests is set to 5 by default. To change this configuration and other browser settings, you can pass in parameters to each -browser switch (each switch represents a node based on your parameters). If you use the -browser parameter, the default browsers will be ignored and only what you specify command line will be used.


maxInstances

maxInstances is an optional parameter which can be passed through the -browser optional parameter. To configure a Selenium Grid Node for 20 instances of Firefox version=X.Y.Z you can use the following solution:

  • Command:

    java -Dwebdriver.gecko.driver=geckodriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser browserName=firefox,version=X.Y.Z,maxInstances=20,platform=WINDOWS
    
  • Grid Console Snapshot:

GidNodeFirefox20


-maxSession

-maxSession is also an optional parameter which can be passed through the -browser optional parameter to configure the maximum number of browsers that can run in parallel on the node. This is different from the maxInstance of supported browsers (Example: For a node that supporting Firefox version A.B.C, Firefox version P.Q.R and Chrome version X.Y.Z, maxSession=1 will ensure that you never have more than 1 browser running. With maxSession=2 you can have 2 Firefox tests executing at the same time, or 1 Firefox and 1 Chrome test).

Example:

java -Dwebdriver.gecko.driver=geckodriver.exe -Dwebdriver.chrome.driver=chromedriver.exe -jar selenium-server-standalone-3.141.59.jar -role node -hub http://192.168.1.125:4444/grid/register -browser "browserName=firefox,version=A.B.C,maxInstances=10,platform=WINDOWS" -browser "browserName=firefox,version=P.Q.R,maxInstances=10,platform=WINDOWS" -browser "browserName=chrome,version=X.Y.Z,maxInstances=20,platform=WINDOWS" -maxSession 2
  • Grid Console Snapshot:

maxSession

undetected Selenium
  • 183,867
  • 41
  • 278
  • 352