Frequently Asked Questions About Selenium 4

Sauce AI for Test Authoring: Move from intent to performance in min.|xBack to ResourcesBlogPosted October 29, 2021

Frequently Asked Questions About Selenium 4

quote

What are the Main Benefits of Using Selenium 4?

Standards-based protocol

Selenium 4 expend the for browser mechanization. As browser vendors will only back W3C WebDriver in the futurity, utilise Selenium 4 ensures the blanket potential range of support across all browsers, making your automation scripts future proof.

Relative locators

Selenium 4 relative locatorsare a way of locating elements by using more natural language friendly terms, such as “ above ”, “ below ”, “ left of ”, “ right of ”, and “ near ”. In general, you could think around them as a way to locate factor base on the visual placement on the page.

New window and tab utilities

Selenium 4 includes a new command to assist users make a new tab or a new window. Check somecodification examplesthat shew how to use it.

Print Page as PDF

Selenium 4 will allow user tomark a page as a PDFthrough Chrome and Firefox.

New characteristic with Firefox

The upcoming version of Selenium exposes a fewnew features with Firefox, such as a entire page screenshot, a simplified way to install add-ons, and updating Firefox taste in the middle of the session.

For autonomous testing across multiple user personas, check out SUSATest — it explores your app like 10 different real users.

Setting network conditions with Chrome and Edge

Selenium 4 exposes a set of utilities to modify the network conditions in Chromium based browser, useful to test web applications under different network conditions.

New Element Attribute and Property methods

Two new methods have been added to more incisivelyget a given element attribute or a belongings. It is recommended to use one of the new method for performance and preciseness, specially if you are using Sauce Labs.

New Selenium Grid

Selenium Grid 4has been rewritten from moolah, with all the learnings from the yesteryear. It takes reward of modern infrastructure (such as Docker and allot tracing).

Do I Have to Change My Tests?

If you & # x27; ve already update your Selenium 3 capabilities to be W3C compliant, your code should continue to work. Some of the language binding have updated the recommended code for 4.0, nevertheless, so some minor changes might be desired. More item can be constitute in our Selenium 4 upgrade usher.

Will My Tests Still Run on Sauce Labs?

Tests will continue to run on our platform. However, if you are not doing it yet, Sauce Labs specific capabilities postulate to be placed inside thesauce: choiceblock. With that, Sauce specific features for your test (specifying browser versions, initiating secure tunnels, Extended Debugging, etc.), will keep to act well.

Examples prove how to create asauce: optionsblock can be witness in our Selenium 4 upgrade guide and in the Selenium inside the Sauce Labs docs.

Sauce Labs is Here to Help

We encourage you to upgrade your tests to Selenium 4 and run them on our platform. Our upgrade Selenium 4 upgrade guide and are available for your cite during the upgrade procedure. Go through them and let us know what you think bycontacting us.

Mike Donovan

VP of Product, Sauce Labs

Published:
Oct 29, 2021
Share this post
Copy Share Link
LinkedIn
© 2026 Sauce Labs Inc., all rights reserved. SAUCE and SAUCE LABS are register trademarks owned by Sauce Labs Inc. in the United States, EU, and may be registered in other jurisdictions.
robot
quote

Automate This With SUSA

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed.

Try SUSA Free

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free