Selenium NPM Tutorial
Selenium JavaScript Installation And Setup
How To Setup Selenium With JavaScript ?
Prerequisites :
Download Node.js and NPM zip from here : https://nodejs.org/en/download/
Extract it at some location.
Set environment variable for extracted folder
=> Copy the full path of node.js folder,goto system properties environment variable,edit path variable in system variables and paste the path there.
To verify installation of - 1. Node.js : Run command "node -v". 2. NPM : Run command "npm -v".
Install a code editor (VS code recommended).
Steps to Setup Selenium with JavaScript :
Open VS code(or any other editor).
Create a new project folder(SeleniumJS) in the workspace.
Open terminal in the editor.
Navigate to that created directory using 'cd' command.
Initialize the project folder using the command - "npm init -y" (Here '-y' is optional and is used to skip the description).
=> It will create a 'package.json' file within the project folder which contains description about dependencies,versions and other details.
Install selenium webdriver using command - "npm install selenium-webdriver".
=> A library named 'node_modules' will be added to your project folder which contains essential libraries for automation.
Install drivers for web browsers using command -"npm install chromedriver".
=> 'chromedriver' library will be added in node_modules.
Setup has done successfully.