Selenium Grid

Selenium grid and parallel test execution

Selenium grid and parallel test execution

In this post, we are going to discuss the usage of selenium grid and parallel test execution. Parallel test execution is an efficient approach to test execution. Selenium grid is one of the techniques to conduct the parallel test execution. In this article, we will answer the following questions:

  • What is selenium Grid?
  • Why do we need parallel test execution?
  • How do we install and setup grid

What is Selenium Grid?

Selenium grid is a part of selenium project. It comprises of two components:

  • Hub
  • Node

The Hub is the central unit which manages the execution of test cases on every node. Node are the machines on which test cases are run simultaneously. In order to work together, every node should be registered to a hub, so that hub can control and manage the execution of test cases on the nodes.Selenium Grid

Every distributed test environment will comprise of one hub and multiple nodes.

What is parallel test execution and why it is needed?

Parallel processing is always a quicker and more efficient way of doing anything. In our day to day life, we keep hearing about multi-tasking. Multi-tasking refers to doing multiple parallel tasks (Wow! sounds so incredible, can human beings do multi-tasking really?).

In computing environment,  if we can use the computing environment to execute tasks in parallel, it can save a lot of time and costs. In automation testing also, we can use various techniques to run tests cases in parallel. Selenium Grid makes it possible as it a hub-node model, where hub can operate multiple nodes running on multiple machines.

Understood, but why do we need to run test cases in parallel? There are two primary reasons to do so:

  • If you have to check the compatibility of your code for multiple browsing environment (different browsers, different versions on different operating systems). Like Firefox running on Windows and Linux or IE 9, 10 and 11.
  • Your test suite (comprising of test cases) is large and takes a lot of time for every run. In this case, you divide the test cases and run on different nodes to save time

Scenarios for parallel test execution

Parallel text execution can be used in multiple scenarios. Consider the case of an e-commerce product like Flipkart, Amazon etc. Increasing competition and customer demand leads to almost daily releases of the software. Even though, the daily release may be with small changes, these companies can’t afford to allow any mistakes and every release will have comprehensive regressions tests for the following:

  • Browser compatibility checks
  • Process correctness
  • User Interface checks

Considering the frequency and size of these applications, it will not be feasible to try and run all the test cases on single nodes for daily releases. Running these tests on multiple nodes is the only way out.

Do nodes need separate machines?

Do we need to run the nodes on separate machines? Not really, we can use virtual machines to run multiple machines on the same server/machine.

Installing Selenium Grid

Selenium Grid server can be downloaded from Selenium official website. Go to the download page and download the Selenium Grid server as shown below:

Selenium Grid Server

 

As on date, the latest version is 3.0.1. Once you download it, just copy it to a folder and add the path of folder to java path. Selenium Grid requires Java and selenium setup as a pre-requisite. Selenium Grid works with Selenium 3.0.

Related Post: How to install and setup Selenium 3.0

Related Post: Basics of Selenium v3.0 [Webinar Recording]

In the next post, I am going to demonstrate how to use Selenium Grid in a real-life scenario by setting up nodes and running the test cases.

Leave a Reply

Your email address will not be published. Required fields are marked *