|  | 
|  | 1 | +--- | 
|  | 2 | +title: "Roadmap for adopting WebDriver Bidi" | 
|  | 3 | +linkTitle: "Proposed roadmap for adopting WebDriver Bidi and deprecating WebDriver Classic" | 
|  | 4 | +date: 2025-03-11 | 
|  | 5 | +tags: ["selenium"] | 
|  | 6 | +categories: [] | 
|  | 7 | +author: Diego Molina [@diemol](https://www.diemol.com) | 
|  | 8 | +description: > | 
|  | 9 | +  A roadmap for how and when Selenium will adopt WebDriver Bidi and deprecate WebDriver Classic. | 
|  | 10 | +--- | 
|  | 11 | + | 
|  | 12 | +Roadmap | 
|  | 13 | + | 
|  | 14 | +In order to automate browsers, Selenium builds upon open standards | 
|  | 15 | +developed by the W3C. The first of these is [W3C | 
|  | 16 | +WebDriver](https://w3c.github.io/webdriver/), which was derived from | 
|  | 17 | +the original wire protocol used by Selenium 2, and this has been | 
|  | 18 | +powering our tests for many years. It works by using a | 
|  | 19 | +"request/response" model: the Selenium APIs send a command, the | 
|  | 20 | +browser executes that, and sends back a response which we process, | 
|  | 21 | +before we send another command. At any one time, there's only one | 
|  | 22 | +command being executed. | 
|  | 23 | + | 
|  | 24 | +However, the Web evolves, and so does the WebDriver standard. The next | 
|  | 25 | +evolution of the W3C standard for browser automation is called | 
|  | 26 | +[WebDriver Bidi](https://w3c.github.io/webdriver-bidi/). This is a | 
|  | 27 | +more sophisticated protocol, leaning heavily on the lessons learned | 
|  | 28 | +from the [Chrome DevTools | 
|  | 29 | +Protocol](https://chromedevtools.github.io/devtools-protocol/) (CDP), | 
|  | 30 | +and the key difference is that rather than following a | 
|  | 31 | +"request/response" model, Bidi now uses an event-based model. While | 
|  | 32 | +this allows the Selenium APIs to ask the browser to execute actions, | 
|  | 33 | +the browser can now send information back at any time to our | 
|  | 34 | +APIs. This allows a more dynamic style of testing than we've been able | 
|  | 35 | +to achieve with the original WebDriver protocol. | 
|  | 36 | + | 
|  | 37 | +One goal of Bidi is that it should be possible to use it for | 
|  | 38 | +everything that the original spec (now commonly referred to as | 
|  | 39 | +"WebDriver Classic" or just "Classic") could do. It seems natural that | 
|  | 40 | +if this is the case, we should consider phasing out the Classic | 
|  | 41 | +protocol and only relying on Bidi, just as we phased out support for | 
|  | 42 | +the original "[JSON Wire | 
|  | 43 | +Protocol](https://www.selenium.dev/documentation/legacy/json_wire_protocol/)". Just | 
|  | 44 | +as with that transition, we will do this carefully so that our users | 
|  | 45 | +(you\!) shouldn't notice the change. | 
|  | 46 | + | 
|  | 47 | +How will we go about this? While this plan can still change, the approach we are taking is: | 
|  | 48 | + | 
|  | 49 | +1. Focus our development time on Bidi.   | 
|  | 50 | +2. Use Bidi to add extra features, such as network interception and capturing JS logs.   | 
|  | 51 | +3. Start to use Bidi in preference to Classic where possible (for example, for navigating to new URLs, or for finding elements)   | 
|  | 52 | +4. Once the Bidi spec becomes a [Candidate Recommendation](https://www.w3.org/standards/types/#x4-2-candidate-recommendation), cease development of the Classic implementation and mark it deprecated.   | 
|  | 53 | +5. Once the Bidi spec becomes a Recommendation, start phasing out Classic support. This will mean that in the next major Selenium release (that is, Selenium 5), only the Java bindings will retain optional legacy Classic support.   | 
|  | 54 | +    | 
|  | 55 | + | 
|  | 56 | +The developers of the Selenium project have already started the first | 
|  | 57 | +two steps, and we shall soon start on the third. | 
|  | 58 | + | 
|  | 59 | +The Bidi spec is now moving forwards quite rapidly, and the first | 
|  | 60 | +public working draft has been published. There are multiple | 
|  | 61 | +implementations of the spec already available, and while it’s being | 
|  | 62 | +adopted by Selenium, it’s also being used by other tools such as | 
|  | 63 | +Puppeteer, Cypress, and even Playwright. | 
0 commit comments