Principle:SeleniumHQ Selenium Grid Component Configuration
| Knowledge Sources | |
|---|---|
| Domains | Distributed_Testing, Configuration, Selenium_Grid |
| Last Updated | 2026-02-11 00:00 GMT |
Overview
Multi-source configuration system for Selenium Grid components supporting TOML files, CLI flags, environment variables, and external state stores.
Description
Grid configuration follows a layered precedence model: CLI flags override TOML file settings, which override environment variables, which override system properties (prefixed with selenium), which override defaults. For distributed deployments, GridRedisClient provides Redis-backed state management for node availability tracking, enabling stateless Grid components. Configuration is consumed through option classes such as BaseServerOptions (port, host), DistributorOptions (slot matcher, slot selector, health check interval, reject unsupported caps, new session thread pool size, purge nodes interval), NewSessionQueueOptions (session request timeout, retry interval, batch size, maximum response delay), SecretOptions (registration secret, server authentication), and RouterOptions (sub-path, disable UI).
Usage
Use TOML configuration files for reproducible Grid setups. Use CLI flags for quick overrides during development. Use Redis backing for production-scale distributed deployments requiring dynamic node registration and health tracking.
Theoretical Basis
# Configuration Precedence (highest to lowest)
1. CLI flags: --port 4444
2. TOML config: [server] port = 4444
3. Environment: SE_PORT=4444
4. System properties: -Dselenium.port=4444
5. Defaults (e.g., DefaultStandaloneConfig, DefaultHubConfig)
# TOML Structure
[server] -> port, host, allow-cors
[node] -> max-sessions, session-timeout, detect-drivers
[distributor] -> slot-matcher, reject-unsupported-caps, newsession-threadpool-size
[router] -> username, password, sub-path, disable-ui
[sessions] -> implementation (local, redis)
[sessionqueue] -> session-request-timeout, session-retry-interval, batch-size