In this tutorial, You will see, How can you Run Multiple Browser on Node. How can you Run Chrome, IE on Node in Selenium Grid? In Selenium Webdriver tutorials, We have seen how to invoke Chrome Driver and invoke IE Driver in Selenium.
Run Chrome on Node in Selenium Grid
To configure the chrome in the Selenium Grid, we need to provide the path of chrome.exe in the create node command.
- First, you need to invoke the hub. To invoke the Hub go to your directory where your Selenium Standalone jar file present and fire the command.
java -jar selenium-server-standalone-2.53.0.jar -role hub
- After this opens the another prompt and fire the command to open the Node. Before firing the command, you need to mention the path of chrome.exe in your command.Like, Our chrome.exe file is present in C:\chromedriver directory, so I need to append the below-mentioned command in the create node command –
- So , To configure the Chrome driver with your Node. You need to fire the below mentioned command –
java -Dwebdriver.chrome.driver=C:\chromedriver\chromedriver.exe -jar selenium-server-standalone-2.53.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556 -browser browserName=chrome
If will not open the browser window after the fire this command because we are not calling any browser window but internally chrome driver has been configured with the selenium Grid.
Like this, you can invoke the IE driver as well. You just need to replace the chrome.exe path with iedriver.exe. I have my IE driver inside the directory C:\IEDriverServer , So for me to configure the IE command would be –
java -Dwebdriver.ie.driver=C:\IEDriverServer\IEDriverServer.exe -jar selenium-server-standalone-2.53.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556 -browser browserName=iexplore
Run Chrome, IE on the Same Node
You have seen, How can you configure the IE and Chrome on the node. Suppose you want to configure the Chrome and IE on the same node. So how can you do this?
To configure the chrome and IE on the same node. You need to run create node command only once.
In previous tutorials you have seen, how can you create the instance of all browsers on the node. In the same way, you need to append the path of chrome.exe and iedriver.exe in that command to configure the chrome and IE at the same node.
Path of chorme.exe and iedriver.exe vary from system to system. So be careful when you run these command on your local system.
In the below command, We are going to invoke and configure chrome and IE same time on the single node.
java -Dwebdriver.chrome.driver=C:\chromedriver\chromedriver.exe -Dwebdriver.ie.driver=C:\IEDriverServer\IEDriverServer.exe -jar selenium-server-standalone-2.53.0.jar -role webdriver -hub http://localhost:4444/grid/register -port 5556 -browser browserName=iexplore -browser browserName=chrome
In the above command, We just append the path of chrome.exe and IEDriverServer.exe and fire it. This will create the one instance of chrome and one of the IE and open the browsers once you will call them in your Test script.
This is all how can we invoke, configure and Manage Browsers in Selenium Grid.