Selenium 4 is releasing soon: What every QA must know?

Muntasir Abdullah Mizan
4 min readDec 4, 2018

--

Selenium 4 version is all set to release this Christmas. Simon Stewart (founding member of Selenium) has officially announced at the recently held selenium conference at Bangalore. Some major changes in the upcoming Selenium 4 have been revealed. So, it’s time to get ahead of the curve and figure out what is going to be changed, added and deprecated. In this article, we will take a look a few important features and give an insight on updates you can expect for your automation framework.

W3C WebDriver Standardization

The Selenium 4 WebDriver will be completely W3C Standardized. The WebDriver API has grown to be relevant outside of Selenium. It is used in multiple tools for automation. For example, it’s used heavily in mobile testing through tools such as Appium and iOS Driver. The W3C standard will encourage compatibility across different software implementations of the WebDriver API.

Let’s take an example of how Selenium Grid communicates with Driver executables as of now –

A test in Selenium 3.x, at local end (through JSON wire protocol), communicates with the browser at End node. This requires encoding and decoding of API. In Selenium 4, the test will directly communicate without any encoding and decoding of API requests (through W3C Protocol) through java bindings will be backward compatible but focusing more on W3C Protocol.

The JSON wire protocol will no longer be used.

There are multiple contributors to WebDriver W3C specs. All of the work done is on GitHub which can be found on- https://github.com/w3c/webdriver

Selenium 4 IDE

The Selenium IDE support for Chrome is in a bucket. As we all know that Selenium IDE is a record and playback tool. It will now be available with much more rich and advanced features such as:

  • New plugin system– Any browser vendor will now be able to easily plug-in to the new selenium IDE. You can have your own locator strategy and can plug in selenium IDE.
  • New CLI runner — It will be completely based on nodeNodejs and not old HTML based runner. It will have following capabilities-
  • WebDriver Playback — The new Selenium IDE runner will be completely based on WebDriver.
  • Parallel execution- The new CLI runner will also support parallel test case execution and will provide useful information like time taken, the number of test cases passed and failed.

Improved Selenium Grid

The one who has worked on Selenium Grid must know how difficult it is to set up and configure. Selenium Grid supports test case execution on different browsers, operating systems, and machines. Thus it provides parallel execution capability.

There are two main elements in Selenium Grid- Hub and Node.

Hub- Acts as a server, a central point to control all the test machines in a network. In selenium grid, there is only one hub which allocates the test execution to a particular node based on capability matches.

Node- In simple words node is a test machine where test cases actually run.

For more details on selenium grid, follow the tutorial here- https://www.seleniumhq.org/docs/07_selenium_grid.jsp

The typical process to setup selenium grid till now caused testers sometimes to face difficulty in connecting node to the hub.

In Selenium 4 the grid experience is going to be easy and smooth. As there will not be any need to set up and start hub and node separately. Once we start selenium server, the grid will act as both hub and node.

Selenium 4 will come up with a more stable selenium grid in terms of removing all thread-safety bugs, and a better support for Docker.

Better Selenium Grid UI

The Selenium 4 would come up with more user-friendly UI of a grid having relevant pieces of information about sessions running, capacity etc.

Better Observability

“Passive observability is the ability to do descriptive tracing.”
– Simon Stewart

Observability, logging and debugging is no more confined to DevOps in recent times. As part of this release request tracing and logging with hooks will be improved so as to provide automation engineers a hold on debugging.

Refreshed Documentation

Documentation plays a key role in any project’s success. Selenium docs were not updated since selenium 2.0 release. In the latest upgrade selenium documentation is also going to be refreshed and detailed [WIP]. You can access it on — https://seleniumhq.github.io/docs/

Selenium 4 In a nutshell

Upgrading to the latest version of selenium should not require any code changes. Setting up node and hub will become smooth and the entire grid experience is going to be streamlined. For automation engineers, the latest version should not be challenging and existing automation framework should work with minimal changes.

More to come

These are a few important changes. Stay tuned as there is plenty more to come.

--

--