Selenium-Grid allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. Essentially, Selenium-Grid support distributed test execution. It allows for running your tests in a *distributed test execution environment*.
Selenium Grid is a component of the Selenium project that allows you run your tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. The tests can be run on any number of machines at the same time.
It provides both environment management and resource allocation as it dispatches your tests against nodes in the grid. The environment management allows you to exert finer-grained control over the environment executed in than Selenium Server provides itself. For example, you can target your tests at specific browser versions or particular platforms.
Selenium Grid consist of HUB and Node. Selenium stand alone server jar executable can work as both Node and Hub. In order to configure Grid there must be a single HUB (selenium server running as HUB), and one or more Nodes (selenium server running as Node) attached to the HUB.
PROS AND CONS
Selenium Grid isn't a silver bullet. It solves a subset of common delegation and distribution problems, but will for example not manage your infrastructure and might not suite your specific needs.
Pros
- Scale. Scale by distributing tests on several machines using parallel execution.
- Central. Manage multiple environments from a central point, making it easy to run the tests against a large combination of browsers and operating systems.
- Minimize. Minimize the maintenance time for the grid by allowing you to implement custom hooks to leverage a virtual infrastructure of registered nodes.
- Cross-Platform. If your tests are running on one particular platform, by using a node on another platform you effectively have cross-platform testing.
- Smart. Grid can route commands to a certain version of a browser if you have two or more nodes registered, each pointing to a different version of the browser binary.
Cons
- Prompted input. You have no capabilities for user input if your tests want to prompt for user input whereas you would if your tests ran locally.
- Maintainability. You also need to maintain the health of other computer systems which run your nodes.
- Limited power. Certain third party libraries have limitations that prevent them from being used in conjunction with Grid.
References: