Selenium Node Container

Selenium 4 Alpha- What to Expect?

Back in August of 2018 the whole testing automation community had been struck by the big news: Simon Stewart, the founding member of Selenium, had officially confirmed the release date and some of the major updates for Selenium 4 at the Selenium Conference in Bangalore. The 4.0 version of the world’s beloved framework for web testing automation was meant to be released by Christmas 2018.

A little delayed, Selenium 4.0 Alpha version is released which can be downloaded from Selenium official website for javascript. Let’s revisit the features which were announced in the Selenium conference and some of the improvements and additional features that are present in this version.

Why Selenium 4.0 is important

If you think that testing automation engineers are the only people in the world who should care about the major update of Selenium, you’re wrong.
Of course, Selenium has become the industry standard for implementing custom automated tests and is considered to be the first go-to solution for every web application that has grown out of an approach where manual testing could have solved the majority of the problems.
But what is often left out of the picture is that businesses that heavily rely on Selenium are not only the ones who have automation QA engineers on their team but also the ones who have integrated codeless automation testing tools based on Selenium.

Selenium-based codeless testing has become a real lifesaver for every business that realizes the importance of automation but doesn’t have in-house QA experts who would be able to implement it. Such tools not only make the deployment possible for anyone with the basic understanding of web browsers but also make it possible to run regression tests, do synthetic monitoring and load testing without any knowledge of Selenium framework at all.

A perfect example of such codeless automation software is CloudQA. On top of Selenium, we’ve developed a tool that requires zero effort from the team, integrates with the third-party applications, makes building test cases easier than ever before, monitors your web page performance 24/7 and costs less than hiring a junior manual tester.

If you want to learn more about the benefits of Selenium-based codeless automation tools, get a free demo.

Selenium 4 major changes

Lets go through the major changes of Selenium 4.0 Alpha version-

W3C WebDriver Standardization

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

Here’s how Selenium Grid communicates with the Driver executables in previous versions:

W3C WebDriver Protocol

A test in Selenium 3.x communicates with the browser at End node through the JSON wire protocol at the local end. This approach requires encoding and decoding of API.

With the updates we’re expecting to see in Selenium 4, the test will directly communicate without any encoding and decoding of API requests through W3C Protocol. Although JAVA bindings will be backward compatible, the focus will remain more on the W3C Protocol. The JSON wire protocol will no longer be used.

There are multiple contributors to the W3C WebDriver specs, and the whole process can be seen on GitHub.

Selenium 4 IDE TNG

Selenium 4 IDE TNG

The Selenium IDE support for Chrome is available now. You can download it from- https://selenium.dev/selenium-ide/ 

As we all know that Selenium IDE is a record and playback tool. It will now be available with the following, much richer and advanced features:

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

Improved Selenium Grid

Anyone who has ever worked with Selenium Grid knows how difficult it is to set up and configure. Selenium Grid supports test case execution on different browsers, operating systems, and machines providing parallel execution capability.

There are two main elements of the Selenium Grid: Hub and Node.

Hub acts as a server, a central point to control all the test machines in the 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, is a test machine where test cases actually run.

Selenium Node Container

For more details on Selenium Grid, we suggest reading the complete official tutorial on Selenium Grid.

Until now, the setup process of the Selenium Grid has often caused testers difficulties with the connecting node to the hub.

In Selenium 4, the grid experience has become smooth and easy since there will no longer be any need to set up and start hubs and nodes separately. Once you start a Selenium server, the grid will act as both a hub and node.

Selenium provides three types of grid-

  1. Standalone Mode
  2. Hub and Node
  3. Fully Distributed

The new selenium server jar contains everything which is required to run a grid. It has all the dependencies. The new grid also comes with Docker Support. For now, the docker integration doesn’t make use of UNIX domain sockets, so ensure your docker daemon is listening on port 2375.

For more details, refer to- https://github.com/SeleniumHQ/selenium/wiki/Selenium-Grid-4

Better Observability

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

Observability, logging and debugging is no more confined to DevOps now. As part of the upcoming release, the request tracing and logging with hooks will be improved to provide automation engineers a hold on debugging.

Refreshed Documentation

Documentation plays a key role in the success of any project. Selenium docs have not been updated since the release of Selenium 2.0. Meaning, that anyone trying to learn Selenium in the past several years, had to use the old tutorials.

So, naturally, the renewed and up-to-date documentation, which SeleniumHQ promises to deliver us along with the 4.0 version, has become one of the most anticipated Selenium updates within the testing automation community.

Improvements in Selenium 4.0 Alpha version-

ChromiumDriver and DevTools:

In Selenium 3, EdgeDriver and ChromeDriver have their own implementation inherited from RemoteWebDriver class. In Selenium 4 Chromedriver and EdgeDriver are inherited from ChromiumDriver. ChromiumDriver class has predefined methods to access the dev tools. Consider the below code snippet-

ChromeDriver Script

The above code creates a session to the given URL and executes javascript to print a message. DevTools is a class which has methods to get a handle on developer options.

DevTools can also be used for performance measurement and get page load time.

Better Window and Tab Management

Selenium 4 now has given the capability to work on two different windows at the same time. This is particularly useful when we want to navigate to a new window(or tab) and open a different URL there and perform some action.
Tab Management Script

newWindow() method opens a new window or tab based on the WindowType given in its parameter.

Relative Locators

In Selenium 4 alpha version we can also get locators relative to any other locator.

  • toLeftOf() : Element located to the left of specified element.
  • toRightOf() : Element located to the right of the specified element.
  • above() : Element located above with respect to the specified element.
  • below() : Element located below with respect to the specified element.
  • near() : Element is at most 50 pixels far away from the specified element. The pixel value can be modified.

Full-Screen Snapshot

Now we can take the full page screenshots with getFullPageScreenshotAs() method in the Firefox. But instead of typecasting it to ‘TakesScreenshot’ interface, we need to typecast it to FirefoxDriver instance.

File src = ((FirefoxDriver) driver).getFullPageScreenshotAs(OutputType.FILE);

There might be some more interesting features and improvements, so go ahead and explore!

Selenium Automation

Why Selenium is the “Best Open Source Tool” for Automation Testing?

Selenium Automation

Why Selenium is the “Best Open Source Tool” for Automation Testing

Technology has provided us with options, but most of the options are not sustainable! They live for a shorter duration and then turn to history! Today technology needs to be unlimited, unconditional, Adaptive to change and seamless, could you think of any tools/technologies that are progressive and stable for more than a decade? We have…

Selenium – A Solid Start later caught up with Hiccups

Jason Huggins who was working with ThoughtWorks was testing an internal application when doing the same thing made him realize, he needs a tool that could reduce manual efforts. He created a Javascript library that later became as Selenium Core and is the base of Selenium Remote Control [RC] and Selenium IDE.

Selenium RC was a storm as it allowed you to control a browser with a software language of user’s choice!

However, the hurricane was obstructed by web apps and the fundamental nature of Selenium based on javascript causing security issues. Simon in Google thought of challenging these limitations and created WebDriver, that was just a perfect solution to Selenium limitations. The brilliant minds gave Automation industry a magic wand with the merging of Webdriver and Selenium in 2008 to provide a standard set of features for all users. Simon the creator of webdriver says –

“Why are the projects merging? Partly because WebDriver addresses some shortcomings in selenium (by being able to bypass the JS sandbox, for example. And we’ve got a gorgeous API), partly because selenium addresses some shortcomings in WebDriver (such as supporting a broader range of browsers) and partly because the main selenium contributors and I felt that it was the best way to offer users the best possible framework.”

Selenium – The Journey

A Quick Glance on what were the different versions of Selenium –

Selenium VersionFeatures/Description
Selenium Remote Control [Selenium RC]The basic version that was started, however, this is no longer active and used.
Selenium 2 [ Webdriver]It comes with

  1. Object-Oriented API
  2. Backward compatible with Selenium 1
  3. Supports the Webdriver API
  4. Provides Maximum flexibility
Selenium IDESelenium IDE (Integrated Development Environment) is a prototyping tool for building test scripts. It is a Firefox plugin and provides an easy-to- use interface for developing automated tests.
Selenium 3.0Selenium 3 is the latest version and is doing wonders in the Automation sector with its new features and support to codeless testing. If you want to dig more on how Selenium 3 could help you Go Codeless, read on our earlier post – Selenium 3 – A Step closer to Codeless testing!

The Road Ahead- Selenium 4.0 and Selenium 5.0

The roadmap of Selenium was discussed in one of the webinars that significantly stresses thatSelenium 3.0 is just a beginning of a new change i.e. W3C Web Driver Implementation that would beintroduced in Selenium 4.0. However, there is speculation that with Selenium 5 Web Driverimplementation may completely be hashed out.The expedition has been adventurous but is sure to sustain with community support, its robustnature and above all as Business author Alan Deutschman said – Change or die! Selenium chose toChange with the latest technology… Would you?

References
#1   #2   #3

LIKE THIS POST SHARE IT WITH YOUR FRIENDS

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on email
Codeless Testing

Selenium 3 - A Step closer to Codeless testing!

Codeless Testing

Selenium 3 – A Step closer to Codeless testing!

July 29, 2016, was a big day for testing professionals with the release of beta version of Selenium 3.0. The online community of testing and QA professionals are flooded with “what, when, how questions on Selenium 3” and individuals are exploring every bit of it. But for a firm like CloudQA who offer “Testing as a Service [TAAS]” what probably could have changed with the release of a newer version? We thought, brainstormed and tested to conclude – we are a step closer to Codeless Testing!

Scratching your head? Read on to know How?

How Selenium 3 is Helping to Go Codeless?

Selenium 3 with its new features could help you achieve codeless testing with its new features –

  1. Selenium 3 supports Java 8, and Java 8 is about concise coding and readability.
  2. Firefox with its driver Mozilla’s Gecko driver [ new feature of Selenium 3] could facilitate codeless testing when combined with Firefox plugin Selenium IDE. The plugin has record and play feature that is quite like QTP record function and helps you create test quickly with the aid of action buttons. However, the plugin cannot be used for complex test suites and comes with a limitation of test automation with simple test cases only.
  3. If you have been using WebDriver API, just a simple import of new Selenium 3 will upgrade your software. And if you combine this with Gauge Framework that supports multiple languages and cross browser testing you could build a business layer [ English-like syntax] on top of your scripts making it easy for the test automation. You may also combine Selenium tool with Robot Framework, Behaviour Driven Development[with Gherkin] or Keyword Driven Framework, then the coding requirement is minimal, and you could get results in favor to codeless testing
  4. Selenium RC is dead, and if you have been using it, it’s time to move on and get an upgrade or else leave codeless testing, you may not be able to run any automation.

Benefits of Codeless Testing

  1. Scripting may need more effort and time, with codeless testing individuals could automate test cases quickly.
  2. No dependency on learning specific language, as users with right framework or plugins would either need to interact with the GUI or use plain English
  3. Domain experts could review the scripts and provide their feedback.
  4. Quick testing means time to market gets reduced and hence an increase in productivity with no compromise in quality
  5. Automate the most complex test cases with ease.

The world needs tools and application that could help them do multitasking! Would you like to be glued to your computer screen debugging a script for #AutomationTesting or would love to click on user interface or type in simple commands in plain English, while you watch your cricket match? The choice is yours!

LIKE THIS POST SHARE IT WITH YOUR FRIENDS

Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on email