How do I run multiple browsers in a single Selenium Node machine. What is command for this in command prompt. Can any body help me on this.
4 Answers
By default, the nodes can run..
RC
- 5 Firefox browsers
- 5 Chrome browsers
- 1 IE browser
WebDriver
- 5 Firefox browsers
- 5 Chrome browsers
- 1 IE browser
So technically, a default node can run 22 browsers at a time. All you need to do, is if you have, say, 2 nodes, when you fire a test at the grid, it allocates 1 test per open machine FIRST then it stacks browsers. Once you run 3 tests, it then opens that third session against the next available browser.
If You'd like to customize this, just create a config.json file, and specify the maxSessions
{
"capabilities":
[
{
"browserName": "*chrome",
"maxInstances": 2,
"seleniumProtocol": "Selenium"
}
],
"configuration":
{
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"maxSession": 10,
"port": 5555,
"register": true,
"registerCycle": 5000,
"hubPort": 4444
}
}
Comments
nothing special about this: just concat the browsers in the start script:
java \
-jar selenium-server-standalone-2.33.0.jar \
-role node \
-browser browserName=**firefox**,version=3.6,maxInstances=5,platform=WINDOWS \
-browser browserName=**chrome**,maxInstances=5,platform=WINDOWS \
-Dwebdriver.chrome.driver=f:\chromedriver.exe
maybe this can be helpful too if you wish to use Grid without the hard work of configuring each node as u grow: efficient we ui testing lab
[disclosure : i work at Ravello]
Comments
Use follwing command while registering node on hub
java - Dwebdriver.chrome.driver=C:\chromedriver.exe -Dwebdriver.ie.driver=C:\internetdriver\IEDriverServer.exe -jar selenium-server-standalone-2.46.0.jar -role webdriver -hub http://192.168.1.10:4444/grid/register -port 7777 -browser browserName=chrome,maxInstances=3, -browser browserName=firefox,maxInstances=3, -browser browserName=iexplore,maxInstances=3 –maxSession 3
Comments
- Selenium itself supports different browsers. (In other answers are given examples how to setup amount of sessions per browser)
- you need to have different Browser-drivers installed (by default there would be FF at least or maybe + chrome)
- in your client part you need to specify which browser to run test on for two browsers it will be two test runs (could be done simultaneously )