Introduction to Selenium Grid

Profile picture for user devraj

Selenium Grid is a smart proxy server that allows Selenium tests to route commands to remote web browser instances. 

Key Points about Selenium Grid

  • Its aim is to provide an easy way to run tests in parallel on multiple machines. Selenium Grid is part of the Selenium project. It lets you distribute test execution across several machines. You can connect to it with Selenium Remote by specifying the browser, browser version, and operating system you want. You specify these values through Selenium Remote's Capabilities.
  • There are two main elements to Selenium Grid -- a hub, and nodes. First you need to stand up a hub. Then you can connect (or "register") nodes to that hub. Nodes are where your tests will run, and the hub is responsible for making sure your tests end up on the right one (e.g., the machine with the operating system and browser you specified in your test).
  • With Selenium Grid, one server acts as the hub that routes JSON formatted test commands to one or more registered Grid nodes. Tests contact the hub to obtain access to remote browser instances. The hub has a list of registered servers that it provides access to, and allows control of these instances.
  • The Selenium Grid is a testing tool which allows us to run our tests on different machines against different browsers. It is a part of the Selenium Suite which specialise in running multiple tests across different browsers, operating system and machines. You can connect to it with Selenium Remote by specifying the browser, browser version, and operating system you want. You specify these values through Selenium Remote’s Capabilities.
  • Selenium Grid allows us to run tests in parallel on multiple machines, and to manage different browser versions and browser configurations centrally (instead of in each individual test).
  • Selenium Grid is not a silver bullet. It solves a subset of common delegation and distribution problems, but will not manage your infrastructure, and might not suit your specific needs.