Selenium 4 — New Features and Enhancements

Enhancements in Selenium 4:

1. Support for Docker
2. Identification of Parent Frame directly improved
3. In Selenium Grid some commands, properties, URL’s have changed and improved.

New Features of Selenium 4:

In Selenium 4, many features have been added till 4.0.0-alpha-7. Some of them are mentioned below:

1. Relative/ Friendly Locators in Selenium 4-

Selenium added some Relative locators in new version as below:

2. Window and Tab Management:

With Selenium 4 new features, we can run two different windows, tab at the same time and navigate between them or new URL’s.

3. Element Screenshot:

In Selenium 3, we could able to take screenshot of an entire page, but from Selenium 4 new released, we can take or capture specific element screenshot by using getScreenshotAs() method.

4. Full page screenshots support for Firefox:

With Selenium 4 new released feature, now we can take full page screenshots with getFullPageScreenshotAs() method in the Firefox. You need to typecast it to FirefoxDriver instance instead of ‘TakesScreenshot’ interface.

5. Element Location(Get Height, Width, Dimension, Coordinates):

Using Selenium 4 new features, we can achieve any specific element’s height, width, Dimension, coordinates by using getRect() method. Selenium 4 added Rectangle class which contains getRect() method to achieve these feature.



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store


Blogger, Software Development, Software Testing