Firefox WebDriver Newsletter — 118 – Firefox Developer Experience

By admin

WebDriver
ORG

is a remote control interface that enables introspection and control of user agents. As such it can help developers to verify that their websites are working and performing well with all major browsers. The protocol is standardized by the

W3C
ORG

and consists of

two
CARDINAL

separate specifications:

WebDriver
ORG

classic (HTTP) and the new

WebDriver BiDi
PRODUCT

(

Bi-Directional
ORG

).

This newsletter gives an overview of the work we’ve done as part of the Firefox

118
CARDINAL

release cycle.

Contributions

With Firefox being an open source project, we are grateful to get contributions from people outside of

Mozilla
ORG

:


Rayyan
PERSON

refactored our navigation helpers to use a

navigationId
NORP

property instead of id

property instead of

Scott Ly
PERSON

updated our tests for exceptions to use appropriate assertion helpers


WebDriver
ORG

code is written in

JavaScript
PRODUCT

,

Python
ORG

, and Rust so any web developer can contribute! Read how to setup the work environment and check the list of mentored issues for

Marionette
PERSON

and geckodriver.

General

Bug fixes

In

Firefox 118
LAW

, a bug was simultaneously fixed for

WebDriver BiDi
ORG

and

Marionette
PERSON

:

Both the

WebDriver
ORG

:PerformActions command in

Marionette
GPE

and the browsingContext.performActions command in

WebDriver BiDi
ORG

failed to correctly scroll for a wheel input source in environments that have a high-resolution display connected


WebDriver BiDi
PRODUCT

Let’s have a look at our

WebDriver BiDi
PRODUCT

updates for

Firefox 118
LAW

, with several improvements and additions to the browsingContext module.

New: “browsingContext.activate” command

Back in Firefox

117
CARDINAL

, we updated browsingContext.create to support a background argument and to open new contexts in the foreground by default. In this release we are adding the browsingContext.activate command which can move an existing tab to the foreground and focus its document. If the tab’s window was in the background, it will also be moved to the front.

Using browsingContext.activate to change the focused tab

New: “browsingContext.userPromptOpened” event

browsingContext.userPromptOpened is a new event which is emitted whenever a prompt of type “alert”, “confirm” or “prompt” is opened. The event’s payload contains the context where the dialog is displayed as well as the dialog’s type and message .

This event will also support "beforeunload" type dialogs in the future, but they are not handled at the moment.

New: “browsingContext.handleUserPrompt” command

User prompts created using window.alert ,

window.confirm
DATE

or window.prompt can now be handled using the new browsingContext.handleUserPrompt command.

This command

first
ORDINAL

takes a context argument, which corresponds to the tab displaying a prompt. Then you can provide an accept boolean to accept or decline dialogs of type "confirm" and "prompt" , as well as a userText string to set the content for "prompt" types. “alert” type dialogs are simply dismissed regardless of the provided arguments. In case there is no prompt in that tab, a NoSuchAlertError error will be thrown.

At the moment, this command cannot handle "beforeunload" prompts, but this should be fixed in an upcoming release.

New: “type” field in the JSON payload

To easily differentiate JSON payloads coming from the remote end, all JSON payloads now include a "type" field which can either be "success" for a successful response to a command, "error" when an error was thrown while handling a command, and finally "event" for any event emitted.


Marionette
PERSON

(

WebDriver
ORG

classic)

Support for Web Authentication extension commands


Dana Keeler
PERSON

added support for all the Web Authentication extension commands , which allow users to authenticate themselves by

Public Key Credentials
ORG

.

Bug fixes

In

Firefox 118
LAW

, the following bug was fixed for

Marionette
ORG

while working on similar features for

WebDriver BiDi
PRODUCT

: