Introducing Selenium 4

As you might know, Selenium is prepared to release yet another version into the market after version 3.9 and it is supposed to be a big update. Selenium is getting ready to eliminate other automation tools by simplifying their packages. Almost 80% of the companies prefer Selenium nowadays because it doesn't require any license and can be easily learned to have such a beautiful library and features.

Selenium 4 Features

  • New relative locators introduced
  • Selenium 4 Grid
  • Methods to take screenshots, open new window or tab
New Relative locators - As explained in one of our previous articles, if you are struggling to get the web element using existing locators, you might want to try new relative locators which are introduced in Selenium 4. These locators are  -
  • toRightOf()
  • toLeftOf()
  • near()
  • above()
  • below()
Selenium 4 Grid -
As you may know, Grid can be used in 3 different ways -
  1. Standalone
  2. Classical Grid(Node and hub)
  3. Fully Distributed(session, distributed, etc)
Methods to take screenshots, open new window or tab in Selenium 4  
A new method getScreenshotAs() is introduced in Selenium 4 which lets you take a screenshot of specific web element. Please consider below code snippet on how to use it -
getScreenshotAs() in Selenium 4

The above code takes a screenshot of a web element only which was not possible in the earlier versions of Selenium.

That's pretty much it from newer version of Selenium. We will cover more articles on the same. Keep Learning and keep sharing.

Comments

Popular posts from this blog

Azure Tutorials Series - Azure Networking

Coforge Interview Questions | Automation Testing profile

Testing in CI/CD