WebdriverIO - Installation of NPM



Once Nodejs has been installed, we have to create a NPM folder. NPM is actually the package manager for writing tests in JavaScript. The official page for NPM is available in the below link −

https://www.npmjs.com/search?q=webdriverio

Once we launch this page, enter WebdriverIO in the search box and click on Search, to get the npm packages for WebdriverIO. The following screen will appear on your computer −

WebdriverIO Page

Create NPM Project

The steps to create a NPM project are listed below −

Step 1 − Create an empty folder, say webdriverIO in a location.

Step 2 − Open the terminal and move from the current directory to the directory of the empty folder that we have created.

Step 3 − Run the following command −

npm init -y

The y parameter is given to set the default values. The following screen will appear on your computer −

Parameter is Given

Step 4 − The output obtained on running the command in Step 3 says that all the default configurations have been captured within the package.json file. It is generated within the folder we have created (named webdriverIO) in Step 1.

The following screen will appear on your computer −

Package.json

This package.json contains all the dependencies which we need to work with the WebdriverIO project. To get any package under NPM, we can refer to the link −

https://www.npmjs.com/

Advertisements