Skip to content

01 Protractor Setup

Biswajit Sundara edited this page Feb 26, 2021 · 4 revisions

1. Install Node.Js

  • Search "node download" in google or go to https://nodejs.org/en/download/
  • For windows download the installer (.msi) as per the system 32 or 64 bit.
  • Once installed go to program files/node js folder and copy the path C:\Program Files\nodejs
  • Create a new environment variable under system variables NODE_HOME with the above path
  • Append the path in Path variable also.
  • Then open command prompt and type this command node -v
  • If it returns the version number like v12.18.2 then node js is successfully installed.

2. Check npm is available

  • npm stands for node package manager. It's included in the Node.Js
  • Open command prompt and type this command npm -v
  • If it returns the version number like 6.14.5 then node js is successfully installed.

3. Install Visual Studio Code IDE

  • We can use IDE like Eclipse, WebStorm however Visual Studio Code is the best IDE for TypeScript
  • This can be downloaded from here - https://code.visualstudio.com/docs?dv=win
  • Visual studio has licensing cost but the community version is free.

4. Install Protractor

  • Open command prompt and type this command npm install -g protractor
  • This will install the protractor.
  • by using npm, we are instructing the package manager to download the protractor package.
  • g stands for global. So this protractor will be available globally.
  • This will be installed at the AppData path C:\Users\Biswajit\AppData\Roaming\npm\node_modules
  • Go to command prompt and type protractor --version, it should return the version like 7.0.0
  • This will also install webdriver-manager

5. Update WebDriver Manager

  • The install protractor command also installs the `webdriver-manager``
  • Check the path C:\Users\Biswajit\AppData\Roaming\npm\node_modules\protractor\node_modules\webdriver-manager
  • Open command prompt and type webdriver-manager update to refresh with latest updates`
  • This package is responsible for supplying browser drivers/ all selenium webdriver functionalities.`

6. Install Type Script

  • Type Script is the super set of Java Script. Means It has all the features from Java Script and more.
  • Open command prompt and type npm install -g typescript to install type script
  • Use the command tsc helloworld.ts to compile/generate the java script file out of type script.

7. UnInstall Protractor

Incase you want to uninstall protractor then use the command npm uninstall protractor

  • npm uninstall is the command to uninstall any node package.
  • To uninstall the globally installed software use npm uninstall -g protractor

8. Best Practice

  • Best practice is to install all the softwares at the project level (not global)
  • Initiate a package.json in your node project
  • Add dependencies and do npm install

Clone this wiki locally