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) :
- 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.
- WebElement.getSize() and WebElement.getLocation() are now replaced with a single method WebElement.getRect().
- They have added driver.switchTo().parentFrame() method.
- The Options class for every browser is now extending the Capabilities class.
- 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:
- 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.
- Basic support is added for using Docker Containers with new Grid Server.
- Now you can configure the location of your Safari driver using the “webdriver.safari.driver” system property.
- Element screenshotting is now possible.
- 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!