Explore Courses Blog Tutorials Interview Questions
0 votes
in DevOps and Agile by (29.3k points)

We're confused about the 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.

Or is MaxInstances the total number of browsers available to the node?

The command that we are using is:

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 


We think the way we are using our node (above) is 5 concurrent test sessions by default.

Does each test have 20 browsers available to it?

Or does each test session share the 20 browsers (10 chrome/10 FF) in a pool - with the other test sessions?

1 Answer

0 votes
by (50.2k points)

Max Instances

This many instances of the same version of the browser can run over the Remote System.

Let’s explain with an example

-browser browserName=firefox,version=12,maxInstances=5,platform=LINUX

-browser browserName=InternetExplorer,version=9.0,maxInstances=5,platform=LINUX

 The above example will allow you to run 5 instances of Firefox 12 and as well as 5 instances of IE9 at the same time in a remote machine.

Max Session

 This says, how many browsers (Any Browser and any version) can run in parallel at a time in the remote system. 

Let’s go with an 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). 

Irrespective of what MaxInstances you have defined.

If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat’s automation testing certification!

Browse Categories