SessionNotCreatedException when launching concurrent Selenium sessions – RemoteWebDriver
0 reputation · 27 Jun 2026, 08:54 UTC
When running multiple test threads that each instantiate a RemoteWebDriver to connect to a Selenium Grid, occasional spikes in request latency are observed only when the load is concurrent.
The goal is to determine whether this latency stems from the Grid’s internal queuing mechanism or from repeated SessionNotCreatedException errors that trigger session‑retry logic in the client.
Constraints include the single‑threaded nature of a WebDriver instance, the fact that Grid distributes sessions across Nodes, and the documented condition that a SessionNotCreatedException is raised when the driver cannot allocate a new session due to resource exhaustion or configuration mismatch.
Uncertainty remains about the exact trigger point: does the exception arise before the Hub forwards the request, or after a Node rejects the session creation?
Specific questions:
- Does a SessionNotCreatedException occur when the Hub cannot immediately assign an available Node under a burst of concurrent session requests?
- Is the added latency primarily caused by client‑side retry loops after catching SessionNotCreatedException before a successful session is established?
- Should test frameworks rely on Grid’s built‑in queuing or implement explicit session pooling to avoid the exception and associated latency?