Friday, August 18Be an Automation Engineer

WebdriverIO

WebdriverIO is a custom implementation for selenium's W3C webdriver API. It is written in Javascript and packaged into 'npm' and runs on Node.js.

Main Features of WebdriverIO:

  • WebdriverIO is a good automation tool which can automate both web applications and native mobile Apps.
  • It has simple and easy to write Syntax.
  • It has integrated test runner which helps us to write asynchronous commands in a synchronous way so that we don’t need to care about how to handle a Promise to avoid racing conditions.
  • It has 'wdio setup wizard' which makes our project setup very easy.
  • We can write our own javascript functions test.
  • The test runner also comes with a variety of hooks that allow us to interfere into the test process in order to e.g. take screenshots if an error occurs or modify the test procedure according to a previous test result.
  • WebdriverIO services will be helpful to integrate our test to third party tools like 'Appium'.
Basic Example programs:

Before installing webdriverio, make sure java is installed in your machine and PATH, JAVA_HOME environment variables are set.

1. Install webdriverio and run first program with wdio test Runner. -- With WDIO test runner.

2. Install webdriverio and run first program without wdio test Runner. -- Without WDIO test runner.

Recent Posts

Element Locators in WebdriverIO

Locators, WebdriverIO

Selenium supports 8 different element locating stategies like @id, @className, @xpath, @css etc.. In selenium we need to specify which locator we are passing like if we are passing xpath then we need to specify it with By.xpath(‘locator’).

WebdriverIO has simplified element location strategies. We don’t need to specify whether we are passing xpath/css. Simply we can write browser.click(‘locator’). WebdriverIO » Continue Reading.

Protractor vs WebdriverIO vs NightWatch

JavaScript, JS, NightwatchJS, Node.js, Protractor, WebdriverIO

JavaScript is now a popular choice of language for developing web applications. To test the applications developed in JavaScript, there seem too many end to end testing frameworks and tools which help in Unit testing, UI testing. However, to use one of them, one has to go through and analyse each tool and framework to know which suits their application » Continue Reading.

A basic example program using webdriverio with wdio test runner

WebdriverIO

Note: This example program is with wdio test runner configured.

1. How to Install?

WebdriverIO is a ‘npm’ package and runs on ‘Node.js‘. So, we need to install ‘Node.js’ and ‘npm’ in our machine before installing WebdriverIO.

Step by step process of installing ‘Node.js’ and ‘npm’ in our Windows / Mac machines.

2. Configure project using wdio » Continue Reading.

Configuring wdio test runner

WebdriverIO

Run the below command in your project location to make the ‘webdriverio’ library available in your project.

npm install webdriverio

Run the below command to configure wdio test runner.

./node_modules/webdriverio/bin/wdio config

A questioner will be displayed as below image. Answer the simple question to configure your project to run webdriverio tests.

A basic example using WebdriverIO: Without test wdio test runner

WebdriverIO

Note: This example program is without any testing framework.

1. How to install?

WebdriverIO is a ‘npm’ package and runs on ‘Node.js‘. So, we need to install ‘Node.js’ and ‘npm’ in our machine before installing WebdriverIO.

Step by step process of installing ‘Node.js’ and ‘npm’ in our Windows / Mac machines.

After installing Node.js, run the below » Continue Reading.

%d bloggers like this: