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 browser at End node.This requires encoding and decoding of API. In Selenium 4, test will directly communicate without any encoding and decoding of API requests (through W3C Protocol) though 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 in webdriver W3C specs. All of the work done is on github which can be found on- https://github.com/w3c/webdriver
Selenium 4 IDE TNG
The Selenium IDE support for Chrome is in bucket. As we all know that Selenium IDE is a record and playback tool. It will now be available with much more rich and advance 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 nodejs 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, number of test cases passed and failed.
Improved Selenium Grid
The one who have worked on Selenium Grid must know how difficult it is to setup 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 hub.
In Selenium 4 the grid experience is going to be easy and smooth. As there will not be any need to setup 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 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 grid having relevant informations about sessions running, capacity etc.
“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.
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.