Protractor, formally known as E2E testing framework, is an open source
functional automation framework designed specifically for Angular JS web
applications. It was introduced during Angular JS 1.2 as a replacement of
the existing E2E testing framework. The Protractor automation tool is
also recommended by Angular JS for scenario testing
- Built on the top of Web driver JS and Selenium server
- Introduced new simple syntax to write tests
- Allows running tests targeting remote addresses
- Can take advantage of Selenium grid to run multiple browsers at once
- Can use Jasmine or Mocha to write test suites
Prerequisites
1. Node Js :
Protractor is a Node.js program. To run Protractor, you will need to have Node.js installedhttps://nodejs.org/en/
Verify Installation
To verify your installation, please type in the command
npm --version
2. Installing Protractor :
For this project, the Protractor framework is being used and configured on a Windows environment. Below are the steps for installation:Open the command prompt and type in the following command to install protractor globally.
npm install –g protractor |
You
can install protractor locally in your project directory. Go to your
project directory and type in the following command in the command
prompt:
npm install protractor |
To verify your installation, please type in the command
Protractor --version |
If
Protractor is installed successfully then the system will display the
installed version. Otherwise you will have to recheck the installation.
3. Installing JDK :
To run Protractor, you will need to have Node.js installedhttp://www.oracle.com/technetwork/java/javase/downloads/
Verify Installation
To verify your installation, please type in the command
java -version
4. Setting Up the Selenium Server :
The webdriver-manager
is a helper tool to easily get an
instance of a Selenium Server running. Use it to download the necessary
binaries with:webdriver-manager update
Now start up a server with:
webdriver-manager start
This will start up a Selenium Server and will output a bunch of info logs. Your Protractor test will send requests to this server to control
a local browser. You can see information about the status of the server at
http://localhost:4444/wd/hub.
Now By default your node should be installed in your user directory and open up "Cmd"Example :
C:\Users\BrahmiP\AppData\Roaming\npm\node_modules\protractor\example>protractor
conf.js