Selenium and Protractor

Protractor: an end-to-end test framework for Angular and AngularJS applications. It is built on top of Selenium’s WebDriverJS for AngularJS applications, and thus can handle angular-specific characteristics.

What is so special about Protractor

  • Protractor uses native events and browser-specific drivers to interact with your application as a user would.
  • It supports Angular-specific locator strategies, such as selecting elements by angular models, bindings, ng-options – and finding elements inside ng-repeat. Some extra locators:
    binding – Find an element by text binding.
    exactBinding – Find an element by exact binding.
    model – Find an element by ng-model expression.
    buttonText – Find a button by text.
    partialButtonText – Find a button by partial text.
    repeater – Find elements inside an ng-repeat.
    exactRepeater – Find an element by exact repeater.
    cssContainingText – Find elements by CSS which contain a certain string.
    options – Find an element by ng-options expression.
    deepCss – Find an element by css selector within the Shadow DOM.
  • It works in sync with Angular – it always knows when Angular is “ready” to be interacted with, so no need to worry about waiting for your test and webpage to sync.
  • It is developed and supported by Google and is in sync with Angular development cycle

Languages it supports
Since Protractor is actually a wrapper around the WebDriverJS – JavaScript selenium bindings, it only understand one language: JavaScript.

However, if you are strong java speaker, there are ways to make Protractor work with Java, by Using ngWebDriver for Java

ngWebDriver is a library in Java built on top of Protractor, with this driver you can do automation in java with Protractor.