The selection between selenium or protractor is based on what type of web application we are automating. If your application is angular based then it is feasible to select protractor. In this post you will learn why to use protractor for web based application.
Protractor runs on top of selenium webdriver hence all the functionalities from selenium by default supported in protractor. In angular application it has different accessors like models, bindings, ng-options and ng-repeat. Protractor has locators for these as well. Apart from that, many other locators are supported in protractor such as.
- buttonText
- partialButtonText
- binding
- exactBinding
- model
- cssContainingText
- options
- deepCss
- repeater
- exactRepeater
- className
- css
- id
- linkText
- js
- name
- partialLinkText
- tagName
- Xpath
It has default waits which wait for angular which is not present in selenium webdriver.
browser.waitForAngularEnabled(false);
It supports behavior driven frameworks such as jasmine, mocha, cucumber etc.
It has ready made plugin image comparison which works great It is not available in webdriver. It has many cool functions listed below.
- baselineFolder
- screenshotPath
- autoSaveBaseline
- debug
- formatImageName
- disableCSSAnimation
- hideScrollBars
- nativeWebScreenshot
- blockOutStatusBar
- ignoreAlpha
- ignoreAntialiasing
- ignoreColors
- ignoreLess
- ignoreNothing
- ignoreTransparentPixel
- rawMisMatchPercentage
- androidOffsets
- iosOffsets
- saveAboveTolerance