DEV Community

Nishant Ranjan
Nishant Ranjan

Posted on

2 1

What is 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.

WebdriverIO

Main Features of WebdriverIO:

  • WebdriverIO is a good automation tool which can automate both web applications and native mobile Apps.
  • 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'.

Installation steps:

To install webdriverIO, you will need node to be installed in your system. Please go through below mentioned post to install it.

Install node in mac and windows

  • Setup your project Before installing dependencies, we will need to initialize a new NPM project. This will allow us to use the CLI to install dependencies in your project.
$ mkdir webdriverio-test && cd webdriverio-test
$ npm init -y
Enter fullscreen mode Exit fullscreen mode

The -y will answer 'yes' to all the prompts, giving you a standard NPM project. Feel free to omit the -y if you'd like to specify your own project details.

  • Install WebdriverIO CLI
$ npm i --save-dev @wdio/cli
Enter fullscreen mode Exit fullscreen mode
  • Generate configuration file Next, we will generate a configuration file to store our WebdriverIO settings.

To do that, just run the configuration utility:

$ npx wdio config -y
Enter fullscreen mode Exit fullscreen mode

That's it! The configurator will install all required packages for you and create a config file called wdio.conf.js.

In next post we will run our first spec using webdriverIO.

Thanks for reading. Please share your thoughts.

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

SurveyJS custom survey software

JavaScript UI Library for Surveys and Forms

Generate dynamic JSON-driven forms directly in your JavaScript app (Angular, React, Vue.js, jQuery) with a fully customizable drag-and-drop form builder. Easily integrate with any backend system and retain full ownership over your data, with no user or form submission limits.

View demo

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay