In Selenium Grid tutorial we will learn about the Selenium Grid, use of Selenium Grid, Configuration of Selenium Grid and how can we use it. First Let’s see, What is Selenium Grid.
Selenium Grid – a distributed test execution environment to speed up the Test Execution. Selenium Grid is a part of the Selenium Suite that specializes in running multiple tests across different browsers, operating systems, and machines in parallel.
Selenium Grid has two versions Grid1 and Grid2. We will use the Grid2 version.
Need of Selenium Grid ?
As you have through entire Selenium WebDriver tutorials. You will find out WebDriver will execute your test cases on a single machine. Here we have some concerns like –
What if you want to execute your test cases for different Operating Systems?
How to run your test cases in the different version of the same browser?
How to run your test cases in multiple browsers?
Why should a scenario wait for execution of other test cases even if it does not depend on upon any test cases?
The Solution for all addressed problems is Selenium GRID.
Later, we will get the idea about how we can overcome these problems using Selenium Grid.
Benefits of Selenium Grid:
Selenium Grid gives the flexibility to distribute your test cases for execution.
Reduces batch processing time.
Can perform multi-browser testing.
Can perform multi-OS testing.
Install Selenium Grid
To use Selenium Grid, First of all you need to configure the Selenium StandAlone Server in your project. Let’s see how can we install the Selenium Grid –
Download the Selenium Server jar file. (Download Here!)
- Click on the Download version link and Download the Server. Save this to your local machine.
- Open command prompt and navigate to a folder where the server is located. Run the server by using below command –
java -jar selenium-server-standalone-2.53.0.jar -role hub
- The hub should successfully be launched. Your command prompt should look similar to the image below –
- Another way to verify whether the hub is running is by using a browser. Selenium Grid, by default, uses port 4444 for its web interface. Simply open up a browser and go to
- This will open the web console of Selenium Grid.
This is the way how can we Install and Run the Selenium Grid in our local machine.