
Selenium Grid is a proxy server that allows running test cases in parallel across different machines, browsers, and operating systems. It implements a hub-node architecture where one hub controls multiple node machines.
๐งโโ๏ธImportance of Selenium Grid:
โ๏ธParallel execution reduces test execution time
โ๏ธCross-browser/cross-platform testing from a single control point
โ๏ธResource optimization by distributing test load
โ๏ธReduced infrastructure costs by utilizing existing machines
โ๏ธBetter test coverage across different environments
๐งโโ๏ธGrid can be setup in two different mode:
- Standalone: is a single-node Grid where all of the Grid components are running on the same machine. This is the easiest way to get started with Selenium Grid but also the least scalable and flexible.
Standalone (single machine) Setupย
- Download selenium-server-<version_number>.jar and place it one a directory
- Run the below command to start Selenium Grid in standalone mode
- java –jar selenium–server-<version>.jar standalone
- Keep running the standalone server and get the grid url
- Check out the Status of Grid session: http//localhost:4444/
- Or: http://192.168.2.50:4444
2. Distributed : One hub will connect with multiple node machines using the same network and execute the test cases in nodes following OS and browser request, this setup is known as Distributed Grid setup. This setup provides a scalable, maintainable way to run distributed tests across different environments. Ex: Docker-based Setup.ย
- Event Bus: It facilitates communication among various components within the Grid components. The default ports of Event Bus are 4442, 4443, and 5557.
- Session Map: It links Session IDs to the specific Node where the session is active. The default port no. is 5556.
- Distributor: This step involves identifying the suitable node for test execution. The default port no. is 5553.
- Router: It actively monitors incoming new session requests. The default port no. is 4444.
Distributed setup and example can be done easily through docker or browserStack is a cloud base services offers mv setup to run multiple or parallel test with grid environment.
Distributed (multi node)Setup

**
๐Learn Grid implementation in ๐ฆ๐ฒ๐น๐ฒ๐ป๐ถ๐๐บ with end-to-end real time project through my Udemy course: ๐ https://shorturl.at/l7U3x |