Selenium 4 Alpha Release: A lot to know, A lot to discuss

Recently Selenium launched the alpha version of Selenium 4 and you might be wondering whether you need to migrate your testing projects to the new version. I can understand your worrisome, but you don’t need to worry as of now because it’s just alpha version, but after next update (beta version) there will be the final release of the Selenium 4. Till then you can make your entire test automation project compatible by injecting this alpha version.

Who should worry most on the release of Selenium 4?

There are many Selenium based codeless test automation tools like Provar (A premier test automation tool for SalesForce), CloudQA, Katalon Studio and more, Their entire software is developed on the top of the Selenium so they might need to perform a quick check in terms of compatibility with other supporting APIs. It’s trending in the QA industry to have a codeless tool made with Selenium and other scripting technologies. It reduces the pain of the testers in many ways.

How to handle Hidden Elements with Selenium WebDriver?

A glimpse on Selenium 4 Alpha Release

On 24th April 2019, Simon Stewart and team launched the alpha version of Selenium 4 at maven repository site with 7 compile dependencies for different browsers. The Selenium 4.0 brings lots of big changes which will definitely give more convenience in designing your tests. It, however, removes some services of the older version because of fewer uses and added some additional features along with modification in the existing one.

We will go through each and every changes introduced in Selenium 4 one by one. Here we go!

How to download Selenium 4 Alpha Release?

As said above, Selenium 4.0 Alpha release is available to download from Maven repository site of dependencies. Click here to download Selenium v4 from mvnrepository.com.

Selenium 4 maven repository

You can either download the jar file or you can resolve dependencies in your existing POM by copying the dependencies statements from maven site.

Selenium 4 Key changes & features

1. Documentation and W3C standard

Seems W3C becomes the global standards body for open source programming languages. 🙂 From Selenium 4 going forwards, the documentation will follow W3C standard. A separate team is working exclusively to design the new document for Selenium. Click here to see the W3C Recommendation of Selenium WebDriver.

Selenium 4 w3c

2. Browsers support revoked for Native Opera and PhantomJS

WebDriver implementation for Opera and PhantomJS will no longer active, hence, the native support will not be available. However, Opera browser is fully built on the Chromium project, therefore, testing functionality on Google Chrome will be applicable to Opera as well.

There is an exclusive headless browser for chrome and firefox, just to fill the gap of PhantomJS.

3. A new API for Actions class

API for actions class has been revamped and legacy API is deprecated. However, the legacy API of Actions class can be used with “Bridge Mode”. It will be deprecated completely once Google Chrome and Microsoft Edge browser push new changes for API, however, Firefox is already incompatibility with new API for Actions class.

Read more about Revamped API here.

4. Window manipulation

Now we can perform all kinds of window manipulation with new Selenium 4.

4. Changes in iframe switching

A new command added to switch back to the parent frame:

driver.switchTo().parentFrame();

5. W3C Endpoint technique to fetch cookies

It fetches named cookie via W3C endpoints which uses GET methods along with the session. If it can’t find the expected cookie then it falls back and searches in the entire list of cookies.

6. Changes to window command (driver.manage().window())

getPosition, setPosition, getSize, setSize have been removed and new method introduced which are getRect, setRect, fullscreen and minimize.

7. WebElement.getLocation()

This method will no longer exist and it is replaced by getRect().

8. Changes with respect to different browsers

Let’s have a look over the changes with respect to different browsers:

Chrome

  • sendDevToolsCommand, setChromeService & setDownloadPath added

  • ChromeOptions will now extend to Capabilities

  • Removed setEnableNativeEvents & setScrollBehavior

Edge & IE

  • Options will now extend to Capabilities

Firefox

  • Added installAddon(path), uninstallAddon(id), addExtensions, setPreference methods

  • Options will now extend to Capabilities

9. Changes to capabilities

Enums like ANDROID, IPAD, IPHONE, OPERA, PHANTOM_JS, and HTMLUNIT are removed and their respective static factory methods are also removed.

10. Changes in Timeouts

driver.manage().timeouts() will no longer exist. Here we need to use get/setTimeouts.

This was all about the key features of Selenium 4 Alpha Release. Share your thoughts in the comment below and don’t miss you join our Facebook group for quick updates on Selenium WebDriver.

Join Inviul fb group

Leave a Reply