This document presents an overview of real-world end-to-end user scenarios we aim to enable via the WebDriver BiDi protocol. Each scenario requires one or more WebDriver BiDi commands and events to be specified, tested, and implemented across browser engines.
The order of implementing specific features is not strictly enforced, but browser vendors are advised to align with it to offer a rich and cross-browser experience to consumers right from the beginning.
This is a highly requested feature and not possible with WebDriver classic.
This scenario loads a web page and uses BiDi event subscription to efficiently get notified about Console API entries (eg. console.log()
) and raised JavaScript errors. In spec terms, this involves:
- Handling sessions
- Navigating to a URL
- Subscribing to events
- Emitting a log event
- Serialization and deserialization of JavaScript values
- Unsubscribing from events
This scenario loads a web page within a new tab, and uses script evaluation to extract content on the page (e.g. the headlines). In spec terms, this involves:
- Some items from the previous scenario
- Creating a new
browsingContext
- Evaluating JavaScript in the page context
- Closing the
browsingContext
This scenario sets up handlers for network events and then navigates to a web page. The provided timing information from the emitted events can be used to measure the page load performance by storing the relevant data eg. in a HAR file. In spec terms, this involves:
- Some items from the previous scenario
- Network events for the request to be sent, and response started and completed
This scenario loads a web page, enters text into a form field via the keyboard, and submits the form via a mouse click before extracting the results from the page. In spec terms, this involves:
- Everything from the previous scenario
- Emulating keyboard input
- Emulating mouse input
- Ability to set files on file inputs
This scenario loads a web page and captures a screenshot. In spec terms, this involves:
- Some items from the previous milestones
- Capturing a screenshot as Base64-encoded string
In this scenario a MutationObserver
is installed by a bootstrap script as early as the document gets created. It watches for changes made to the DOM tree and sends the relevant updates to the client. In spec terms, this involves:
- Some items from the previous scenarios
- Adding a preload script
- Installing the preload script
- Back channel for communicating with the client
- Removing a preload script
This scenario loads a web page and uses network request interception to replace any image in that page with a custom image. In spec terms, this involves:
- Some items from the previous scenarios
- Intercepting network requests
This scenario loads a web page that is protected behind user credentials. In spec terms, this involves:
- Some items from the previous scenarios
- The event for a HTTP auth challenge
- The command to provide the authentication response
This scenario loads a web page with a registered beforeunload
event handler. After updating the value of some form input elements it should be checked that navigating away opens the beforeonload prompt. In spec terms, this involves:
- Some items from the previous scenarios
- The event when a user prompt opens
- Handling the beforeunload prompt
- The event when a user prompt closes
This scenario loads a web page and prints it as a PDF. In spec terms, this involves:
- Some items from the previous milestones
- Printing to PDF as Base64-encoded string
This scenario opens multiple web pages at the same time, and performs tests that require switching between those pages.
- Some items from the previous milestones
- Activating a top-level context
This scenario sets cookies to be used when loading a web page and its subresources, loads that page, and verifies that the correct cookies were sent with the requests. It also inspects the cookies set by the responses, and clears all cookies to reset the state. In spec terms, this involves:
- Some items from the previous milestones
- Getting cookies
- Setting cookies
- Deleting cookies
This scenario changes the browser window dimensions and position, maximizes/minimizes the window, and toggles full-screen mode while testing the side effects of these actions on the web page.
- Some items from the previous milestones
- Add commands for resizing and positioning browser windows