Selenium 4

A comprehensive guide to Selenium 4

Selenium was created by Sauce Labs co-founder Jason Huggins and it spawned the cloud-based automating testing category. This guide, developed by core project contributors Diego Molina and Titus Fortner, is designed to help you get the most out of the latest version of Selenium.

Asset > Selenium 4 Badge 900x700

Upgrade to Selenium 4 to get the most out of your automated testing

The latest version of Selenium delivers a host of new features. This comprehensive guide will help you get the most out of them and give you tips on updating the tests you run on Sauce Labs.

How to upgrade to Selenium 4

This article will help you go through the steps to upgrade your project dependencies and understand the major deprecations and changes the version upgrade brings.

New features for Firefox

Selenium 4 exposes a few new features that can be used with Firefox, such as installing/uninstalling add-ons, changing browser preferences mid-session, or taking full page screenshots for debugging.

New window & tab utilities

Does your test require opening a new tab or window? Selenium 4 includes a new command to make sure your automation script handles this without any unexpected results.

Relative locators

A new way of locating elements by using natural language terms such as “above”, “below”, “left of”, “right of”, and “near”. Think of them as a way to locate elements based on the visual placement on the page.

BiDirectional APIs

Bidirectional APIs in Selenium 4 will allow you to intercept network requests, mock backends, perform basic authentication, view the console logs, and more.

Updates to Selenium Grid

Selenium Grid 4 has been rewritten from scratch to take advantage of modern infrastructure features such as Docker and distributed tracing. You can now also extend local Grid capabilities using Sauce to Go.

selenium framework

Webinar

So You Think You're Ready for Selenium 4?

In this webinar, Sauce experts and Selenium team members will discuss the new features of Selenium 4 and how they will affect and benefit your existing Selenium tests.

Learn more about Selenium 4

In this Appium Conference session, Diego Molina, Software Engineer at Sauce Labs, demonstrates how Appium can be used with Selenium Grid 4 with an overview of how Grid 4 works, details on configuring Grid 4 to make it work with Appium, and tips for migrating from Grid 3 to Grid 4.

Meeting with laptops

Frequently Asked Questions

This blog post answers commonly-asked questions about Selenium 4 and the W3C protocol, what changes you can make to be compliant, and more.

Update your tests today

Our documentation gives a complete overview of the W3C WebDriver spec and will help ensure your tests are compliant and can successfully execute on Sauce Labs.

Usable code samples

Our experts maintain projects with demo code in each major language in our Sauce Labs Training Github Organization. See our Selenium 4 Documentation page for explanations and links to working Selenium 4 code in our demo repositories.

Developer Saucebot

Run your Selenium tests on the world’s most comprehensive continuous testing cloud