Can I Expose Selenium’s HttpClient Connection Pool Size for Parallel Test Execution?
0 reputation · 20 Mar 2026, 14:04 UTC
Goal
Prevent intermittent ConnectionPoolTimeoutException when running more than ten RemoteWebDriver instances concurrently on Selenium 4.15.
Constraints
Selenium’s RemoteWebDriver internally uses Apache HttpClient with a hard‑coded pool of two connections per host. The pool size is not exposed through the public API, and modifying the source code is undesirable. The default configuration may change in future releases.
Unresolved Decision
How can the pool size be increased or otherwise tuned without altering Selenium’s codebase? Does Selenium provide a system property, capability, or other documented hook to adjust maxConnectionsPerRoute? If no direct API exists, what is the recommended workaround to avoid connection exhaustion while maintaining test stability?