Header Ads

How To Open Multiple Instances Of Different Browsers Through Selenium

Testing websites through selenium is a hotcake now days. It is also equally important to check how the site looks like in different browsers. Till date the process of such checking were sequential.like first set the target as IE browser then check and again set the target as Chrome and then Firefox etc The advancement in technology made the possibilities to check them in parallel. For such thing we don't need to  change our testing approach in a big way. It is only change in the starting of the test.

We need to start 3/4 browsers at the beginning of each test. This post will show how to open 3/4 browsers and 3/4 instance of each browsers at the beginning of the test.It is all about a command to open such possibilities.

java -Dwebdriver.chrome.driver=C:\jar\chromedriver.exe 
-Dwebdriver.ie.driver=C:\jar\IEDriverServer.exe 
-jar selenium-server-standalone-2.38.0.jar -role node 
-hub http://169.254.61.93:4444/grid/register -port 5556 
-browser browserName=firefox,maxInstances=4 
-browser browserName=chrome,maxInstances=4 
-browser browserName=iexplorer,maxInstances=4 
-browser browserName=safari,maxInstances=4 -maxSession 6

Now the things you require..

  • Chrome driver
  • IE driver
  • Firefox driver
[32/64 bit depending on your test machine configuration]

you need to provide the correct path for the same.
hope that helps!!
Powered by Blogger.