Earn Money in 10 days

Selenium Videos

Protractor In Selenium

Livechat

Wednesday, 4 July 2018

Protractor in Testing

Now a days most of the applications are built on angular js.Angular js applications are very fast in loading so we get synchronization issue with selenium.

Angular js web element can't automate by selenium webdriver.Because angular js attributes are ng repeater,ng controller,ng binder,ngmodel.
Selenium locators can be identify by Id,Name,Link Dom,Css etc.So Protractor can handle those attributes which can't automate by selenium.

What is Angular Js?
Angular js is a open source framework for front end and web application.It is developed by Google and written java-script. Angulr js application which uses extended html syntax to express web application component.Basically it is used in dynamic web application.
Angular js extends html with ng directives.

  1. Ng app directives defines an angular js application.
  2. Ng-model directive binds the value of html controls(input,select) to application data.
  3. Ng-Bind directive binds application data to html view.
Synchronization issue in angular js application.
Selenium goes by line by line execution.These elements take some time to load.By the time if selenium search for these elements sometimes its load and sometimes don't.If selenium take some action on it they are not present so it will be synchronization issue.

Automation on angular applications By Protractor
  1. Protractor is an end to end test framework for angular js applications.
  2. Protector which is built on top of selenium can handle angular elements.
  3. Protractor is purely javascript and you can.t use any other language like c# and java.
Protractor  Test Framework

Protractor is a nodeJs program.To Run you will need to have node .js installed.You will download protector package using npm which comes with node.js.

What is nodejs.
Node js is open source cross platform java-script run time environment for excecuting java script code server side.

Installation of Protractor
  1. Open Command Prompt
  2. Type "npm install –g protractor" and Press Enter.
It will install two command line tools.
  1. Protractor
  2. webdriver-manager
Web-driver manager is a helper tool to easily get an instance of selenium server running. 


In the Next post i will show you installation and various scenarios of protractor automation.



Popular Posts

 
subscribe
Subscribe Us
emailSubscribe to our mailing list to get the updates to your email inbox... We can't wait more to have your email in our subscribers email list. Just put your nice email in below box: