Open In App

AngularJS End to End (E2E) Testing Protractor Installation and Setup

The Protractor is an end-to-end test framework developed for Angular and AngularJS applications. It runs tests against the application interacting with it as a real user would, running in a real browser.

 



Features of Protractor:

Installation procedure for Protractor: 



Protractor can be installed globally over NodeJS using the command given below:

// For Windows
npm install -g protractor

// For Linux
sudo npm install -g protractor

Note: For users in Ubuntu, you need to add sudo to all the given commands for permission.

Now to check if the installation was successful let’s check the version of the protractor using the command given below:

protractor --version

The above screenshot says the version is 7.0.0 which means the installation was successful.

Setup: Now we have two commands available to us after the installation which are protractor and webdriver-manager. The webdriver-manager is a helper tool to easily get an instance of a Selenium Server running. There are two steps to be followed now:

Updating the binaries: We can update the necessary binaries using the below command.

// For Windows
webdriver-manager update

// For Linux
sudo webdriver-manager update

Starting the server: After this, we can run Selenium Server using the below command.

// For Windows
webdriver-manager start

// For Linux
sudo webdriver-manager start

After this, you can access the server at http://localhost:4444/wd/hub.

Article Tags :