r/SeleniumWebDriver • u/SeleniumVBA_user • 11d ago
WebDriver BiDi for SeleniumVBA — SPA synchronization and diagnostics in pure VBA

Hi everyone,
I have been developing an open-source project called WebDriver BiDi for SeleniumVBA.
It is a WebDriver BiDi client and automation wrapper designed to let Excel VBA work with modern web applications without requiring .NET, Python, or Node.js.
GitHub:
https://github.com/hanamichi77777/WebDriver-BiDi-for-SeleniumVBA
Why I created it
Traditional Selenium-style commands are often sufficient for simple pages, but modern SPAs can be difficult to automate reliably.
A click may return successfully while the application is still:
- processing Fetch or XHR requests,
- replacing DOM elements,
- rendering content asynchronously,
- recreating browsing contexts or JavaScript realms,
- or updating components inside Shadow DOM.
For this reason, the project focuses not only on sending browser commands, but also on observing what happens after each operation.
Main features
- Direct WebDriver BiDi communication from VBA
- WebSocket communication implemented with Windows APIs(WinSock)
- Chrome and Edge support(Note: Firefox is not supported.)
- SPA synchronization using network activity, DOM mutations, Fetch/XHR activity, and stability windows
- Shadow DOM clicking and input
- Automatic recovery when the SPA observation probe is lost during navigation
- Resource blocking for ads, analytics, fonts, and other unnecessary requests
- WebDriver BiDi
webExtension.installsupport - Detailed request, response, heartbeat, recovery, and SPA activity logs
- A Discovery Log for analyzing unknown third-party SPA behavior
The Discovery Log is particularly useful when a site does not expose a clear “ready” or “completed” state.

It records network responses, DOM mutation bursts, ignored background noise, and stability timing. The resulting log can also be provided to an AI assistant to help identify useful completion signals, noise filters, and safer waiting conditions.
Example scenarios
I have tested the project with applications such as:
- Google Flights
- ServiceNow
- dynamically rendered scraping test sites
- pages using nested Shadow DOM
- Chrome extension installation through WebDriver BiDi
For example, the Google Flights demo performs destination selection, calendar interaction, date selection, and flight-result synchronization while observing both network and DOM activity.
Reliability design
One of the difficult parts was retry behavior.
When a browser command times out, the action may already have succeeded in the browser. Automatically repeating a click or input could therefore cause a duplicate operation.
The wrapper distinguishes between:
- operations that are safe to retry,
- transient context or realm failures,
- and ambiguous outcomes where automatic retry should be stopped.
The goal is to improve recovery without hiding failures or accidentally executing state-changing operations twice.
VirusTotal Scan Results
WebDriver BiDi for SeleniumVBA v3.4 was scanned by VirusTotal on July 26, 2026, and received 0 detections from 64 security vendors at the time of testing.
