logo logo

What’s New In Selenium 4?

main post image

You might be aware that Selenium 4 Alpha release has been launched a few days ago (although there has yet to be any official announcement on the matter). Naturally, you might be wondering whether you should migrate your existing Selenium Project from version 3 to 4? Well, my answer would be: No, you shouldn’t do that.

This is an “Alpha” release and there are high chances that it might not be stable enough. Hence, until Selenium 4 is officially released, I wouldn’t recommend upgrading/migrating your existing Selenium Project (Here you can learn more about “Alpha” phase of release life cycles and other types of software release phases).

But until it’s officially released – How can you know whether your existing test automation project would be affected if you upgrade to Selenium 4? Well, the main objective of Selenium 4 is to comply with the Selenium Project as per the W3C standards. The Selenium Project Team is doing their best to avoid major changes as much as possible.

Nonetheless, below are some of the major changes of the Selenium 4 Alpha release (not specific to any language binding) :

  1. Support for Opera and PhantomJS browsers has been removed, since the WebDriver implementations for these browsers are no longer under active development. So, would you have to create manual tests for Opera browser? And what about Headless Test Executions?
    • Well, since Opera is built using Chromium open source project (The project behind Chrome browser), the behavior of Chrome and Opera should be very similar. Hence, there are fewer chances of having different behaviors and you can simply test Chrome as the Opera browser. And you can still automate Chrome as it is still supported of course.
    • And as for Headless Tests, you can use Chrome Headless or Firefox Headless instead of PhantomJS.
  1. WebElement.getSize() and WebElement.getLocation() are now replaced with a single method WebElement.getRect().
  2. They have added driver.switchTo().parentFrame() method.
  3. The Options class for every browser is now extending the Capabilities class.
  4. For WebDriver Window, the getPosition & getSize methods were replaced by getRect method and the setPosition & setSize methods were replaced by setRect method. Fullscreen and minimize methods have been added as well, so that the WebDriver window can now be fullscreen or minimized.

 

Additionally to that, below are some of the major changes specific to Java language binding for Selenium 4 Alpha release:

  1. There is a New Grid Server (which is also Alpha version) supporting “standalone”, “hub”, “node”, and completely distributed usage. This new Grid Server is able to output logs in single-line json format to the stdout.
  2. Basic support is added for using Docker Containers with new Grid Server.
  3. Now you can configure the location of your Safari driver using the “webdriver.safari.driver” system property.
  4. Element screenshotting is now possible.
  5. Many deprecated methods and classes are deleted.

 

Looks like there are a lot of exciting new changes coming along, and we will definitely be on the lookout for when Selenium 4 is officially launched  😎 

What are your thoughts on these changes to Selenium? Feel free to share your opinion and feedback in the comments section!

 

TestProject Test Automation Tool

Avatar

About the author

Faiz Modi

Passionate for Automation and Enthusiastic for Quality Assurance. Have been assuring Quality since 5+ Years. I always believe in keep learning and growing as well as sharing knowledge, thoughts and opinions with others as much as possible so that it is beneficial for everyone involved!

Join TestProject Community

Get full access to the world's first cloud-based, open source friendly testing community. Enjoy TestProject's end-to-end test automation Platform, Forum, Blog and Docs - All for FREE.

Join Us Now

Comments

16 2 comments
  • Avatar
    renuka gaikwad August 30, 2019, 8:29 am

    More interested in the iframe, as we have to traverse lot to find element.
    Previously we have to everytime switched to default frame and traverse again.
    Question is : if we use the driver.switchTo().parentFrame() so it will switch to top default frame or just one frame up of child?
    e.g F1->F2->F3->F4 now I am at frame 4 , so if I use parentFrame then it will switch to F1 or F3?

  • Avatar
    abhids788 September 5, 2019, 11:01 am

    I think this should be F1. There is no sense of traversing backward.

Leave a Reply

Join TestProject Newsletter

Join a 20K community of readers! Always stay up-to-date with all the latest test automation trends, best practice and tips shared by leading software testing community experts across the globe!

FacebookLinkedInTwitterEmail