Protractor intro to automate angularJS apps

These days, most of the web development uses angularJS library for it’s light weight and ease of use, protractor become popular to do end to end testing for angularJS apps.

Protractor is a node.js program built on top of WebDriverJS (selenium web driver in Java script). that simulates user actions on browser.

Why protractor

  • Extending web driver features -Supports all features of  selenium web driver and extending itself to support for angularJS.
  • Auto synchronisation – no need of automatic waiting for user actions, so we need not to explicitly add waits to our test.
  • Installation is quite straight forward (by use of npm command)
  • Several IDEs to write protractor tests – Atom, Visual Studio code, Eclipse, Sublime text etc
  • Protractor uses Jasmine or Mocha framework for syntax (popular framework used to test java script)
  • can be used to test both angular and non-angular based applications

Protractor Architecture

Protractor programming language

Protractor tests can be written in java script or typescript.

Promises and control flow

As we discussed, protractor is based on WebDriverJS which is using promises, 

Promise example

With out promise

Refer promises and control flow for more information.


For more information about protractor with jasmine model – follow protractor style guide

For more information on protractor, follow protractor api

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *