Download the Selenium Server JAR and start a Hub node: `java -jar selenium-server.jar hub` — the Hub listens on port 4444 by default and coordinates test distribution.
On each machine that will run browsers, start a Node: `java -jar selenium-server.jar node --hub http://hub-host:4444` — the Node registers its available browsers and capabilities with the Hub automatically.
Point your WebDriver tests at the Hub URL by creating a `RemoteWebDriver` with `new RemoteWebDriver(new URL('http://hub-host:4444'), capabilities)` — the Hub routes each session to a matching Node.
Use `DesiredCapabilities` or the W3C `Options` classes to specify browser name, version, and platform so the Hub selects the correct Node for each test.
Monitor the Grid's status and active sessions via the Hub's web console at `http://hub-host:4444/ui` to diagnose capacity issues and session queuing.
Known gotchas
Node registration is based on the Node's self-reported capabilities. If a Node machine lacks the browser binary or driver (e.g., `chromedriver`) on its PATH, the Node will register but sessions routed to it will fail immediately — validate driver installation separately.
Selenium Grid 4 introduced a fully distributed architecture (Router, Distributor, Session Map, etc.) that replaces the single-Hub/Node model. Documentation for Grid 3 and Grid 4 co-exists online; ensure you are reading the correct version for your deployment.
Idle sessions that are not explicitly quit consume slots on Nodes. Always call `driver.quit()` — not just `driver.close()` — in test teardown to release the Grid session and browser process.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp