Features and Improvements in Selenium 4

Mar 2, 2023 | Consultant

While Selenium 4 had already made its entry loud, some of its features have made it even more popular. Its accessibility across a variety of browsers and OS makes Selenium quite an adaptive and automated testing framework for web developers. And you don’t need to use only one programming language to make its Test Scripts as it offers you multiple languages.

So, here is a quick check on Selenium 4’s new features and enhancements. Have a look!

New enhancements

  • There is a direct improvement in recognizing the parent frame.
  • Selenium 4 offers increased Docker support.
  • Many properties, URLs and commands in Selenium Grid are enhanced.

New Features

  • Gives great support to Relative Locators
  • Native Chrome Development Tools is benefited with new API in order to get some in-depth Chrome development characteristics such as
    • Network
    • Security
    • Application Cache
    • Profiler
    • Target CDP Domains
    • Fetch
    • Performance and
    • Resource Timing
  • Offers support in case of Microsoft Edge Browser for Chromium Driver
  • Makes use of W3C Standard native support in place of the JSON wire protocol
  • It can be run in multiple browsers simultaneously by using multiple tabs

Some detailed info, for better clarity:
Tabs and Windows Management:

Selenium 4 offers you running multiple windows and navigating different URLs at a time. And while using Chrome, it also allows you to run two different tabs in the same browser session. Furthermore, it has a rectangle tool for you to have a precise screenshot and the location of a particular WebElement.

Chromium Driver and DevTools:

Selenium 3 offers EdgeDriver and ChromeDeriver’s own executions which extend from RemoteWebDriver. On the other hand, Selenium 4 offers new executions of ChromeDevTools having ChromeDriver and EdgeDriver extended from ChromiumDriver. So, when you operate the Chrome browser, you are able to inspect various Developer Tools in Chrome.

Relative Locators:

Usually, while automation test writing, Xpath or CSS locators help locate that item. For example: on searching through names, IDs or link texts. But Selenium 4 has an enhanced feature called Relative Locators, which helps you find the element by closely searching your element. There are several ways to find such relative elements viz.

  1. To search an element on the right of the definite element, use toRightOf().
  2. To search an element which is on the left of the definite element, use toLeftOf().
  3. To search an element below the definite element, use below().
  4. To search an element above the definite element, use above().
  5. To search an element located at 50 pixels far-off from the definite element, use near(). Here, you may also modify your pixel value.

These ways are signified above or overloaded except a WebElement or a By. Presently, a Maven repository has deployed Selenium 4.0.0-alpha-3.

Free Consultation