Tuesday, 31 May 2016

Quick Idea about protractor

Protractor, formally known as E2E testing framework, is an open source functional automation framework designed specifically for AngularJS web applications. It was introduced during AngularJS 1.2 as a replacement of the existing E2E testing framework. The Protractor automation tool is also recommended by AngularJS for scenario testing. 
Salient features of the Protractor Automation tool:
  1. Built on the top of WebdriverJS 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 WebDriver, so it contains every feature that is available in the Selenium WebDriver. Additionally, Protractor provides some new locator strategies and functions which are very helpful to automate the AngularJS application. Examples include things like: waitForAngular, By.binding, By.repeater, By.textarea, By.model, WebElement.all, WebElement.evaluate, etc.
AngularJS team added accessors to angular models, bindings, ng-options – and finding elements inside ng-repeat. These additions make querying for elements much easier.
For example – let’s get all the ages of the cats that the repeater 
<div ng-repeat="cat in pets">
<span>{{cat.name}}</span>
<span>{{cat.age}}</span>
</div>
 var ages = element.all( by.repeater('cat in pets').column('{{cat.age}}'));


No comments:

Post a Comment