Selenium and WebdriverIO — A Historical Overview

Germain Boue
5 min readMar 14, 2019

Imagine a world without automation? A world in which following a code merge a full manual regression pass would be required? This might be do-able for a small application but what about for a more complex one like Facebook? Manual testing relies on humans, and humans are prone to grow tired of repetitive tasks. This could lead to missing crucial bugs that could entail losing customers and possibly hurting your bottom line. The goal of testing is to catch bugs but more importantly: catch them early.

A project by the name of “JavaScriptTestRunner” was born to provide a solution to the elephant in the room. Not too long after in 2004, Selenium was created by Jason Huggins. This was the first technology adapted on a mass scale that allowed to control browser actions directly. It revolutionized the testing landscape and later was renamed Selenium Core.

Selenium is a group of tools used for automation purposes.

Selenium Integrated Development Environment (IDE) is the simplest and easy to learn component or tool in the Selenium automation testing suite. IDE is a Firefox plug-in & a Chrome extension which can be installed easily to record and execute frequent test cases quickly. The user interactions with the web browser are recorded and test cases are created based on these recordings. It’s most prominent feature which is the playback (formerly also recording) tool for authoring functional tests means that there is no need to learn a test scripting language.

Selenium RC was the main Selenium project for a long time before the WebDriver merge. Before Selenium RC came into existence, testers used to locally install the copies of Selenium Core and web server with web applications to be tested so that, they both would belong to the single domain.

Selenium Grid is a tool used together with Selenium RC to run tests on different machines against different browsers in parallel. That is, running multiple tests at the same time against different machines running different browsers and operating systems. It is useful to spread the load of testing across several machines, and to run tests in browsers running on different platforms or operating systems.

Selenium WebDriver (2006) is a browser automation framework that accepts commands and sends them to a browser. It is the official Node.JS implementation of the JSONWire (WebDriver Wire) Protocol by the Selenium team. It is implemented through a browser-specific driver. It controls the browser by directly communicating with it. Selenium Webdriver API helps in communication between languages and browsers. Every browser has different logic of performing actions like loading a page, closing the browser etc.

Each browser contains separate browser driver. Browser drivers communicate with respective browser without revealing the internal logic of browser’s functionality. When a browser driver is received any command then that command will be executed on the respective browser and the response will go back in the form of HTTP response.

In 2008, the whole Selenium team decide to merge WebDriver with RC (Remote Control) in order to form more power tool called Selenium 2.0 = Selenium IDE + Selenium RC + Selenium WebDriver + Selenium Grid.

Selenium is believed to be a standard and the best suite of testing tool as of today. A few reasons I can think of are the following:

  • Open Source
  • Free to use
  • Supports test scripts written in any user preferred languages such as C#, Java, Perl, PHP, Python, and Ruby
  • Has a strong community that is important when looking for answers/debugging
  • Supports testing on different web browsers such as Chrome, Firefox, Internet Explorer (IE), Opera, and Safari.
  • Strong integration: TestNG, JUnit, Jenkins, Docker, and Maven to attain continuous testing

In the Javascript world, WebDriverJs is the Official Javascript implementation of Selenium. It uses the Selenium’s Json-wire-protocol to interact with browser as selenium java does. It is written by selenium guys. Webdriverjs is packaged as ‘selenium-webdriver’ under npm package which runs on nodejs.

WebdriverIO is an independent implementation of the JSON Wire Protocol by Christian Bromann. It is a test framework for Node.js. It wraps its lower level requests into useful commands, with a concise syntax. There are several reasons why I enjoy writing webdriverIO over other options:

  1. WebdriverIO is fully built using Javascript. This means that if you are comfortable with JS you can immediately start writing automation using their documentation. It also means, that it is front end friendly by nature. Your team members do not need to learn a new language and it can easily be adopted
  2. It’s syntax is simple. You essentially grab an element via selectors and call a method on it. It is compatible with most assertion libraries and testing framework such as mocha or jasmine
  3. The Page Object pattern is a convention that is easily put in place with webdriverIO (https://webdriver.io/docs/pageobjects.html) By placing all the getters and functions in a Page Object, you can import within spec and keep your code readable. This means your specs serve as documentation for non-technical individuals. As well, if a it block fails, by using best coding practices your web devs can debug faster
  4. It also comes with a test runner and the configuration utility helps you create a config file in a matter of seconds. It contains plenty of comments, and you can start customizing your project within a matter of minutes

I’d highly recommend getting familiar with WebdriverIO if you are working on the front end side on UI automation. The documentation are clear and setting up is relatively easy. It offers a lot of options for customization and it uses Selenium under the hood.

Sources: https://www.seleniumhq.org/projects/remote-control/

http://webdriver.io

--

--