Selenium BiDi Protocol: Configuring Network Interception Without Legacy Polling
0 reputation · 23 Mar 2026, 10:53 UTC
Selenium BiDi Protocol Configuration
Goal: enable real‑time network request interception using the BiDi protocol while avoiding the legacy polling model. The browser must support BiDi (e.g., Chrome 115+). Selenium must be instantiated with the appropriate capability to expose the BiDi endpoint. Mixing legacy WebDriver commands with BiDi listeners can lead to state desynchronization; the current implementation does not guarantee full parity across engines.
Constraints: the BiDi capability is optional and must be explicitly requested. The session must maintain a persistent WebSocket connection; a dropped connection can leave the test in an indeterminate state. No proven strategy exists for automatic reconnection or fallback to legacy polling.
- What capability should be set to enable network interception via BiDi?
- Which command sequence causes unpredictable state when mixing legacy WebDriver commands with BiDi listeners?
- What recovery strategy is recommended if a BiDi listener disconnects mid‑session?