SlideShare a Scribd company logo
by Dejan Toteff
How to build faster
e2e tests with
Protractor
● E2E testing framework
● Developed by Google
● Created especially for Angular
applications
● Can be used with non Angular sites as
well
What is Protractor?
Insights on Protractor testing
● Continuous integration
● Integration tests
● Test Driven Development
Why we need E2E tests?
● They are slow to write
● Debugging is not a straightforward
process
● Short life cycle without update
What are the main issues
with writing e2e tests?
● Well-documented
● Integrated with headless and regular
browsers
● Easy to set up
● Very powerful API
What are the pros of
Protractor?
● It is not build for complex user
interactions
● Works at its best only with Chrome
● It doesn’t work well with nested
promises
What are the cons of
Protractor?
Time for some example code
● Make a habit to use element.all(by...).
count() to be sure that you create most
suitable element selector.
Protractor tips
● Expect false errors. To confirm an error,
run the tests under alternative OS
Protractor tips
● Beware of the async nature of
Protractor.
● If something doesn't work as expected
go Protractor native, i.e. using .then()
Protractor tips
● Don't abstract the code directly to the
PageObject. Often this abstraction lead
to errors.
Protractor tips
● Other possible issue is when the
element is not in the visible part of the
browser’s screen.
Protractor tips
● Avoid use of browser.sleep() right after
browser.waitForAngular()
Protractor tips
● If you stumble on an error, that the
element you are clicking on is not
attached to the document, that means
that this is not a testable scenario
Protractor tips
● Once you set the browser size, it persist
in your tests until the next browser.
setSize() declaration
Protractor tips
● Popups and animation can temporary
disable Protractor.
Protractor tips
● The behaviour of .then() method of
Protractor’s .map(), .each(), .filter() can
be weird.
Protractor tips
● One falsy selection can ruin all the tests.
Protractor is hard to debug mainly
because in such occasions
Protractor tips
● To make scroll down work, first you
need to focus the to the "window" by
clicking on any element within the
window.
Protractor tips
● Make all your clicks statement either
inside the tests, or in the PageObject.
Protractor tips
● https://github.com/lkrnac/primediser/tree/blog-2014-04-05-
measuring-code-coverage-by-protractor
● https://github.com/bennyhat/protractor-istanbul-plugin
● http://lkrnac.net/blog/2014/04/measuring-code-coverage-by-
protractor/
Walk the extra mile
https://github.
com/selfrefactor/Protractor-testing-
patterns
Shortlink: j.mp/endToEnd
Most of slides of this
presentation are based on:
Thank you
for your
attention
Protractor
testing is
actually
easy

More Related Content

PDF
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
PPTX
Angular js automation using protractor
PDF
Protractor: Tips & Tricks
PDF
Workshop - E2e tests with protractor
PDF
AngularJS and Protractor
PPTX
Protractor overview
PDF
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
PPTX
Automated Testing using JavaScript
TestingAR XX - Protractor e2e Test Framework - Introduction what we have lear...
Angular js automation using protractor
Protractor: Tips & Tricks
Workshop - E2e tests with protractor
AngularJS and Protractor
Protractor overview
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Automated Testing using JavaScript

What's hot (20)

PPTX
Angular UI Testing with Protractor
PPTX
Protractor for angularJS
PPTX
Protractor
PPTX
An Introduction to AngularJS End to End Testing using Protractor
DOCX
Protractor end-to-end testing framework for angular js
PDF
Introduction to Protractor
PPTX
Automation using Javascript
PDF
UI Testing Automation
PPTX
Protractor training
PPTX
Protractor Tutorial Quality in Agile 2015
PDF
Automated Web Testing using JavaScript
PPTX
Testing of React JS app
PDF
Mastering Test Automation: How to Use Selenium Successfully
PPTX
Better End-to-End Testing with Page Objects Model using Protractor
PPT
Intro to Service Worker API and its use cases
PPTX
Automated Smoke Tests with Protractor
PPTX
Introduction to Protractor - Habilelabs
PPTX
Automated UI testing done right (DDDSydney)
PDF
Automated Testing in Angular Slides
PDF
Making cross browser tests beautiful
Angular UI Testing with Protractor
Protractor for angularJS
Protractor
An Introduction to AngularJS End to End Testing using Protractor
Protractor end-to-end testing framework for angular js
Introduction to Protractor
Automation using Javascript
UI Testing Automation
Protractor training
Protractor Tutorial Quality in Agile 2015
Automated Web Testing using JavaScript
Testing of React JS app
Mastering Test Automation: How to Use Selenium Successfully
Better End-to-End Testing with Page Objects Model using Protractor
Intro to Service Worker API and its use cases
Automated Smoke Tests with Protractor
Introduction to Protractor - Habilelabs
Automated UI testing done right (DDDSydney)
Automated Testing in Angular Slides
Making cross browser tests beautiful
Ad

Viewers also liked (14)

PPTX
Protractor Training in Pune by QuickITDotnet
PPTX
Unit testing of java script and angularjs application using Karma Jasmine Fra...
PDF
Introduction to Express and Grunt
PPTX
Publish Subscribe pattern - Design Patterns
PDF
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
KEY
Publish and Subscribe
PPTX
Publish subscribe model overview
PPTX
Protractor framework – how to make stable e2e tests for Angular applications
PPTX
Introduction to Angular 2
PDF
Bower & Grunt - A practical workflow
PPTX
Functional Reactive Programming with RxJS
PDF
Сергей Больщиков "Protractor Tips & Tricks"
PDF
Sharing (less) Pain of using Protractor & WebDriver
PPTX
RxJS and Reactive Programming - Modern Web UI - May 2015
Protractor Training in Pune by QuickITDotnet
Unit testing of java script and angularjs application using Karma Jasmine Fra...
Introduction to Express and Grunt
Publish Subscribe pattern - Design Patterns
Optimising Your Front End Workflow With Symfony, Twig, Bower and Gulp
Publish and Subscribe
Publish subscribe model overview
Protractor framework – how to make stable e2e tests for Angular applications
Introduction to Angular 2
Bower & Grunt - A practical workflow
Functional Reactive Programming with RxJS
Сергей Больщиков "Protractor Tips & Tricks"
Sharing (less) Pain of using Protractor & WebDriver
RxJS and Reactive Programming - Modern Web UI - May 2015
Ad

Similar to Insights on Protractor testing (20)

PDF
Writing Tests with the Unity Test Framework
PDF
Introduction to Continuous Delivery
PPTX
Protractor End To End Testing For AngularJS
PDF
Passing the Joel Test in the PHP World (phpbnl10)
PDF
Tooling Matters - Development tools
PDF
10 Best Puppeteer Alternatives in Web Scraping.pdf
ODP
Alexandre Iline Rit 2010 Java Fxui
PDF
Android Test Driven Development & Android Unit Testing
ODP
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
PDF
Cynthia Wu: Satisfaction Not Guaranteed
PDF
Error handling
PDF
Android Frameworks: Highlighting the Need for a Solid Development Framework 
PPTX
Full Stack 2019 edition
PDF
Software Testing Basic Concepts
PDF
Tdd in swift
PDF
Test-Driven Development (TDD) in Swift
PDF
Services, tools & practices for a software house
PDF
Guide to Playwright Debugging – Tips and Techniques.pdf
ODP
Dev presentation
PDF
playwrithgttttttttttttttttttttttSlides.pdf
Writing Tests with the Unity Test Framework
Introduction to Continuous Delivery
Protractor End To End Testing For AngularJS
Passing the Joel Test in the PHP World (phpbnl10)
Tooling Matters - Development tools
10 Best Puppeteer Alternatives in Web Scraping.pdf
Alexandre Iline Rit 2010 Java Fxui
Android Test Driven Development & Android Unit Testing
RandomTest - Random Software Integration Tests That Just Work for C/C++, Java...
Cynthia Wu: Satisfaction Not Guaranteed
Error handling
Android Frameworks: Highlighting the Need for a Solid Development Framework 
Full Stack 2019 edition
Software Testing Basic Concepts
Tdd in swift
Test-Driven Development (TDD) in Swift
Services, tools & practices for a software house
Guide to Playwright Debugging – Tips and Techniques.pdf
Dev presentation
playwrithgttttttttttttttttttttttSlides.pdf

More from Dejan Toteff (8)

PDF
Welcome to NPM search 2.0
PPTX
Common mistakes by beginners in Programming
PDF
Просто Аз | история за деца
PDF
Блогване - Защо, Как и Къде
PDF
Best Google+ communities for information and fun
PDF
Списък от полезни сайтове за деца
PDF
Полезни ресурси за подобряване на информираността
PPT
Negotiation in the daily life
Welcome to NPM search 2.0
Common mistakes by beginners in Programming
Просто Аз | история за деца
Блогване - Защо, Как и Къде
Best Google+ communities for information and fun
Списък от полезни сайтове за деца
Полезни ресурси за подобряване на информираността
Negotiation in the daily life

Recently uploaded (20)

PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
cuic standard and advanced reporting.pdf
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Building Integrated photovoltaic BIPV_UPV.pdf
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
Big Data Technologies - Introduction.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Mobile App Security Testing_ A Comprehensive Guide.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Unlocking AI with Model Context Protocol (MCP)
The Rise and Fall of 3GPP – Time for a Sabbatical?
Advanced methodologies resolving dimensionality complications for autism neur...
cuic standard and advanced reporting.pdf
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25 Week I
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Building Integrated photovoltaic BIPV_UPV.pdf
The AUB Centre for AI in Media Proposal.docx
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
“AI and Expert System Decision Support & Business Intelligence Systems”
Big Data Technologies - Introduction.pptx

Insights on Protractor testing