Friday, August 18Be an Automation Engineer

Protractor

Protractor is an End-to-End test framework for AngularJS applications. It is built on top of WebDriverJS, which is an official implementation of W3C WebDriver API. Hence, Protractor extends all WebDriverJS functionalities which help in automating all end users actions against a variety of web browsers.

In addition, Protractor has additional set of functions which help in angular specific locator strategies. It also helps in waiting automatically while angular loads while without protractor one should add waits and sleeps explicitly for AngularJS apps.

Internal architecture of protractor

Our assumption is that the reader of this blog is from a testing background. Hence, the posts in here try to explain all frameworks without assuming that you know either JavaScript or any testing frameworks like Jasmine.

Setup

Before installing protractor, make sure java is installed in your machine and PATH, JAVA_HOME environment variables are set.

 

Create and execute a test
Full material

Recent Posts

Take screenshot for every failed spec in protractor+jasmine

Jasmine, Protractor, TypeScript
Why we need screenshots?

Generally we need screenshot of the browser where the protractor got failed. It would increase our chances to quickly figure out the issue before getting into the code debug. 

How to take a screen shot in protractor?

Below is the code to take a screenshot using protractor.

browser.takeScreenshot().then(function (png) { var dirPath = './reports/screenshots/'; if (!fs.existsSync('./reports')) » Continue Reading.
Protractor with jasmine data provider – Write once test many times

Protractor with jasmine data provider – Write once test many times

Jasmine, JavaScript, Protractor
What is data provider?

When it comes to automation, data provider is an approach to pass test data to the automation tests. Each and every automation tool has it’s own way of providing test data to the automation When we take TestNG framework, it has @DataProvider annotation which will help to pass test data to the automation test.

Why we » Continue Reading.
%d bloggers like this: