Google+

Selenium Grid - A concept for simultaneously executing tests on multiple machines and multiple browsers

Selenium Grid is neither a tool having GUI, nor an API like Selenium RC / WebDriver. Instead Selenium Grid is just a concept, which will allow us to distribute the multiple tests across multiple machines, multiple Operating Systems and multiple browsers for execution.



Selenium Grid speed up the execution process when there are huge number of tests. i.e. Huge list of tests will be distributed across multiple machines and executed at the same time for reducing the execution time. For example, if one test is executing on machine 1, at the same time another test will get executed on machine 2.

Example: Lets say, we have 10 tests where each test takes 1 minute each. If you are not using Selenium Grid, then one test will be executed after another in the same machine and hence takes 10 minutes of time for executing 10 tests. But if we use Selenium Grid to distribute these tests across 5 machines, then 5 tests will be executed at the same time and hence it takes only 2 minutes for executing all the 10 tests.

Hub and Nodes

Using Hub and Nodes concept, Selenium Grid will distribute the tests across multiple machines, operating systems and browsers. Selenium Grid uses Hub as the central machine and uses it to distribute the tests for execution across multiple machines which are knows as Nodes. The below diagram depicts how Selenium Grid uses Hub and Nodes concept to distribute the tests across multiple machines, OS and browsers:




Versions of Selenium Grid

Selenium Grid has the two versions i.e. Selenium Grid 1 and Selenium Grid 2. Selenium Grid 1 can be used with the outdated Selenium RC and hence Selenium Grid 1 can be ignored. Selenium Grid 2 can be used with the latest Selenium WebDriver and hence it is the latest Selenium Grid version used in the market.

Conclusion

Selenium Grid is a concept using which we can define multiple machines as Hub &  Nodes, and distribute the tests across multiple machines, operating systems and browsers. The purpose of Selenium Grid is to run multiple tests simultaneously across multiple machines to reduce the execution time of tests. 

No comments: