Sunday 28 February 2016

Angular JS Protractor Installation process - Tutorial Part 1


                     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

 Features of the Protractor:
  1. Built on the top of Web driver JS and Selenium server
  2. Introduced new simple syntax to write tests
  3. Allows running tests targeting remote addresses
  4. Can take advantage of Selenium grid to run multiple browsers at once
  5. Can use Jasmine or Mocha to write test suites
 Protractor is a wrapper (built on the top) around Selenium Web Driver, so it contains every feature that is available in the Selenium Web Driver. Additionally, Protractor provides some new locator strategies and functions which are very helpful to automate the Angular JS application. Examples include things like: waitForAngular, By.binding, By.repeater, By.textarea, By.model, WebElement.all, WebElement.evaluate, etc.


Prerequisites

1. Node Js :

 Protractor is a Node.js program. To run Protractor, you will need to have Node.js installed
 https://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
Install Protractor Locally
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
Verify Installation
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 installed
http://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




Angular JS Protractor Installation process - Tutorial Part 1

                     Protractor, formally known as E2E testing framework, is an open source functional automation framework designed spe...