Requirements: Protractor requires the following dependencies to be installed prior to installation:
Installation:
Download and install Node.js from this URL: https://nodejs.org/en/
To see if the Node.js installation is successfull, you can go and check the Environment variables. The 'Path' under System Variables will be automatically updated.
You can also check the same by typing the command npm -version
in command prompt which will give you the installed version.
Now Protractor can be installed in two ways: Locally or Globally.
We can install protractor in a specified folder or project directory location. If we install in a project directory, every time we run, we should run from that location only.
To install locally in project directory, navigate to the project folder and type the command
npm install protractor
To install Protractor globally run the command:
$ npm install -g protractor
This will install two command line tools, protractor
and webdriver-manager
.
Run protractor --version
to ensure protractor was successfully installed.
webdriver-manager
is used to download the browser driver binaries and start the selenium server.
Download the browser driver binaries with:
$ webdriver-manager update
Start the selenium server with:
$ webdriver-manager start
To download internet explorer driver, run the command webdriver-manager update --ie
in command prompt.
This will download IEDriverServer.exe in your selenium folder