Let’s understand the Selenium Grid with a simple test scenario.
If you have 5 different test case for login scenario. And you need to run all these 5 test cases in different OS and different browser to check the compatibility. What process you should follow to achieve this?
One possible is to create different test case for different OS and for each OS create different test case for different browsers. And run the whole test case in one machine by changing the OS virtually. IS that the good approach?
Obviously, No. If you will follow this process, then you will waste lots of time to configure your OS and Browsers. Also, for running the whole test case in a single go is another a big challenge. Because it will take more time to execute the whole test case. So, we should not follow this process.
Let’s check another possibility.
Create a master- slave system and distributed system. Then write the test code in master system and configure based on slave system. And run the test script in master system.
In this process, your whole test case would divided in to smaller test case and divided in multiple slave system and run separately. As a result, your execution time become less as compared to previous way.
The component Selenium Grid supports this process in which we can run our script in different OS and browser simultaneously in a stipulated time. You can run the test cases parallel in multiple environment and multiple platforms.
Master / Hub :
Master is a central point or a local machine which receives all the test request and distribute among the nodes / slaves connected with it. This is also called as Hub. There can only be one Hub/Master in Selenium grid network. The Master / Hub actually triggers the test case, but the test cases will be executed in the Nodes / Slave
Slave / Node:
Nodes / Slaves are the selenium instances which are executed the test case triggered by Hub / Master. Nodes can have different platform like windows, Safari, Firefox, MAC etc