Webdriver.io is javascript based test automation framework built over node.js. It is an open source project developed for automation testing community. Webdriver.IO is extendable, compatible, feature rich, and easy to install. It is considered Next-gen test automation framework which supports both desktop browsers and mobile apps, which makes Webdriver.io a favourable option for selenium automation testing. It supports BDD and TDD test framework. This latest version Webdriver.io is 5.x.

Webdriver.io  Architecture:

WebdriverIO Architecture

This architecture contains:

  1. Nodejs- Nodejs is an open source project which may help to run the javascript runtime environment.
  2. Webdriver.io – Webdriver.io created on top of NodeJS which communicates with NodeJS.
  3. Javascript- The script  is written by the user with the help of the Webdriver.io library.

What is Webdriver.io framework popular for?

It has many features like it supports many reports and services, test Frameworks and also Test Runners.

The following reporters are:

  • Allure Reporter
  • Concise Reporter
  • Dot Reporter
  • Spec Reporter
  • Sumologic Reporter
  • Report Portal reporter
  • HTML Reporter
  • JSON Reporter
  • Timeline Reporter
  • Cucumber JSON Reporter

Here are the following examples of any supported services

  • Appium service
  • Devtools service
  • Firefox Profile service
  • Selenium standalone service
  • Shared store service
  • Static server service
  • Reportportal service
  • Docker service

The prerequisites for Webdriver.io are

Installing node and npm

To do the basic setup we require to have Node.js installed and to check whether it is installed or not just type node –v and run the command.


$ node –v

When it is installed correctly ,by default install npm which is nothing but the node package manager.Npm helps user to install a third party library.

$ npm -v

Install webdriverIO CLI

next step is installation of CLI dependency we need to run the following command

npm i –save-dev @wdio/cli

This command gets added to the package .Json file.

Enter the following command to create the WebdriverIO config file

./node_modules/.bin/wdio config –y

by this command we can configure the following packages automatically

  • @wdio/local-runner
  • @wdio/mocha-framework
  • @wdio/spec-reporter
  • @wdio-chromedriver-service
  • @wdio/sync – chromedriver

What are the best practices of WebdriverIO Testing with Selenium Grid:

  • It makes use of text and visual logs to make debugging easier by keeping the track of the action performed with each commands. Visual logs create screenshots of each step which also helps us to understand application behaviour and troubleshoot when it is expected outcome which is not achieved.
  • This user may also record test execution to supervise which fails and understand why it is failed. This enables precise debugging.Keep in mind that it is used to lengthen execution time.

WebDriver can be considered as an independent implementation of the JSON wire protocol. It is nothing but the test framework for Node.js. It always wraps its lower level of requests into the useful commands. There are many reasons for using webDriver io like:

WebDriver IO is built on the javascript. It means that if we are comfortable with the JS we can easily start writing the automation using their documentation. It also means that it is front end friendly by nature. Our team members will not need to learn a new language and it can easily be adopted. The main syntax will be simple as it is essential to grab an element through the selectors and also call on method on it. It is compatible with many assertion libraries and testing framework will be jasmine. There are many page object model patterns that have a convention which is easily put in the place with webDriver.io. By keeping all the functions in the page object we can import the spec and read the code. The specs serves as the documentation for the non-technical individuals.

Questions

1. What is webDriver io?

2. What is the importance of webDriver .io?

Leave a Reply

Your email address will not be published. Required fields are marked *