Intent to Prototype: WebDriver-BiDi

Skip to first unread message

James Graham

Jun 3, 2021, 6:06:51 AM6/3/21
Summary: WebDriver-BiDi defines a WebSockets-based, bidirectional,
protocol for external tools to interact with and control a web browser.
The initial target use case is automated testing of web applications.
The specification is a work in progress, but we intend to begin
prototyping immediately in order to support the development of a modern,
standards-based, web application testing ecosystem.



Platform coverage: All

Preference: ``. Values are `1` (BiDi only), `2`
(CDP only) and `3` (CDP and BiDi). Default is `3` in Firefox Nightly and
`2` on release branches. Enabling the server for these protocols also
requires launching Firefox with the `--remote-debugging-port` command
line argument.

web-platform-tests: There is no existing testsuite, but we will create
and use web-platform-tests whenever possible during development. These
will live in testing/web-platform/tests/webdriver/tests/bidi



WebDriver [1] is the current W3C standard for automated testing, used by
popular clients such as Selenium. However WebDriver's HTTP-based
command/response protocol doesn't match the highly asynchronous nature
of modern browser engines. As a result, many modern test tools such as
Puppeteer, PlayWright, and Cypress have moved toward using proprietary
bidirectional protocols in order to offer deeper integration with the
browser and additional functionality that doesn't fit into the WebDriver

The most common choice for these tools is to use Chrome's Devtools
Protocol (CDP). Even primarily WebDriver-based tools such as Selenium
are now offering additional functionality for Chromium-based browsers
using CDP. This provides an incentive for authors to invest in
Chrome-only testing, and represents a significant web compatibility risk.

WebDriver-BiDi is being developed by the Browser Tools and Testing
Working Group [2] at W3C to provide a cross-browser protocol for browser
automation that meets the requirements of web application testing tools.
By working with both browser vendors and client authors, we hope it will
be possible to smoothly transition the automation and testing ecosystem
back onto a standards footing.

We currently have a partial implementation of CDP in Firefox aimed at
supporting Puppeteer. Once this is no longer actively used by major
testing tools we intend to remove it from the browser.

Although the specification is still in an early state, we want to start
implementing it in Firefox Nightly in order to ship a preview version as
soon as possible. This will enable us to validate the design choices,
and in particular check it's possible to transition existing tools
towards the standard. Further details about the implementation plans can
be found in the design document [3].

Reply all
Reply to author
0 new messages