SlideShare a Scribd company logo
1 of 61
Download to read offline
Protractor's
Tips & Tricks
Sergey N.
Bolshchikov
Developer Advocate @ Wix
Creator of js-must-watch list
Co-organizer of YouGottaLoveFrontend
Protractor's
Tips & Tricks
Heavily
Opinionated List
Protractor
e2e testing framework that
runs test in a browser
interacting as a real user
Protractor
Is not
Always
Fun
● Best Practices
● Tricks
● Performance
● Run & Debug
Best
Practices
Problem 1
Unknown window size
when the browser is
opened
Solution 1
Set the required window
size before every test
Solution 1
Problem 2
Small change in html
can many changes in
tests
Solution 2
Page Object and Page
Fragments that introduce
additional level of
abstraction
Problem 3
Changing html
structure (tags/classes)
will break tests
Solution 3
Solution 3
Solution 3
Problem 4
Complicated tests with
many checks are hard
to read
Solution 4
Problem 5
Many tests lead to
hairy long and
complicated test
structure
Solution 5
Tips &
Tricks
Problem 1
Sharing values between
tests
Solution 1
Problem 2
Setting a new value in
tag
Solution 2
Problem 3
Classical click is simple
but how about right mouse
button click?
Solution 3
Problem 4
Still can’t find a protractor
method that fits your
purposes?
Solution 4
Problem 5
Testing non-angular
application with
protractor?
Problem 6
Tests are good but don’t
pass in IE
Performance
Problem One and Only
Running e2e tests takes
too much time
Solution 1
Use sharding configuration
for running several
browser instances
Solution 1
Solution 1
Note: sharding is per file
so create several testing
files
Solution 2
Disable ng-animate and
css animations
Solution 3
The right balance between
amount of s and
s
Run &
Debugging
Problem 1
Hard to debug the test
Solution 1
Integration with IDE
such as
Intellij/Webstorm
Problem 2
Something is wrong
and you have no idea
why
Solution 2
Interactive REPL
Element explorer
Solution 2
Solution 2
Elementor
Problem 3
Run in CI in all major
browsers
Solution 3
Use Sauce Labs with
credentials specified
directly in protractor
config file.
Solution 3
Thanks!
http://bolshchikov.net
http://blog.bolshchikov.net
http://il.linkedin.com/in/bolshchikov
http://github.com/bolshchikov

More Related Content

What's hot

UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
AgileEngine
 
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Applitools
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
Applitools
 

What's hot (20)

TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
TGT#13 - UI Tests Automation Framework in Evolve EDM – Case Study - Mateusz R...
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Automated Testing in Angular Slides
Automated Testing in Angular SlidesAutomated Testing in Angular Slides
Automated Testing in Angular Slides
 
Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully Mastering Test Automation: How to Use Selenium Successfully
Mastering Test Automation: How to Use Selenium Successfully
 
Protractor for angularJS
Protractor for angularJSProtractor for angularJS
Protractor for angularJS
 
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
Mastering UI automation at Scale: Key Lessons and Best Practices (By Fernando...
 
Nightwatch JS for End to End Tests
Nightwatch JS for End to End TestsNightwatch JS for End to End Tests
Nightwatch JS for End to End Tests
 
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
[Webinar] Continuous Testing Done Right: Test Automation at the World's Leadi...
 
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)Automate testing with behat, selenium, phantom js and nightwatch.js (5)
Automate testing with behat, selenium, phantom js and nightwatch.js (5)
 
Intro to Service Worker API and its use cases
Intro to Service Worker API and its use casesIntro to Service Worker API and its use cases
Intro to Service Worker API and its use cases
 
CI / CD w/ Codeception
CI / CD w/ CodeceptionCI / CD w/ Codeception
CI / CD w/ Codeception
 
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLCUI Testing Automation - Alex Kalinovsky - CreamTec LLC
UI Testing Automation - Alex Kalinovsky - CreamTec LLC
 
Testing of React JS app
Testing of React JS appTesting of React JS app
Testing of React JS app
 
Codeception: introduction to php testing
Codeception: introduction to php testingCodeception: introduction to php testing
Codeception: introduction to php testing
 
Protractor end-to-end testing framework for angular js
Protractor   end-to-end testing framework for angular jsProtractor   end-to-end testing framework for angular js
Protractor end-to-end testing framework for angular js
 
Testing with Codeception
Testing with CodeceptionTesting with Codeception
Testing with Codeception
 
Getting By Without "QA"
Getting By Without "QA"Getting By Without "QA"
Getting By Without "QA"
 
Automation Frame works Instruction Sheet
Automation Frame works Instruction SheetAutomation Frame works Instruction Sheet
Automation Frame works Instruction Sheet
 
Test Driven Development using QUnit
Test Driven Development using QUnitTest Driven Development using QUnit
Test Driven Development using QUnit
 
Codeception introduction and use in Yii
Codeception introduction and use in YiiCodeception introduction and use in Yii
Codeception introduction and use in Yii
 

Viewers also liked

Using a protractor
Using a protractorUsing a protractor
Using a protractor
fknights
 

Viewers also liked (20)

Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Better End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using ProtractorBetter End-to-End Testing with Page Objects Model using Protractor
Better End-to-End Testing with Page Objects Model using Protractor
 
Introduction to Protractor
Introduction to ProtractorIntroduction to Protractor
Introduction to Protractor
 
Sharing the pain using Protractor
Sharing the pain using ProtractorSharing the pain using Protractor
Sharing the pain using Protractor
 
Angular UI Testing with Protractor
Angular UI Testing with ProtractorAngular UI Testing with Protractor
Angular UI Testing with Protractor
 
Automated Web Testing using JavaScript
Automated Web Testing using JavaScriptAutomated Web Testing using JavaScript
Automated Web Testing using JavaScript
 
Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"Сергей Больщиков "Protractor Tips & Tricks"
Сергей Больщиков "Protractor Tips & Tricks"
 
Protractor powerpoint
Protractor powerpointProtractor powerpoint
Protractor powerpoint
 
Protractor training
Protractor trainingProtractor training
Protractor training
 
Automated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and SeleniumAutomated Testing with Cucumber, PhantomJS and Selenium
Automated Testing with Cucumber, PhantomJS and Selenium
 
ProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applicationsProtractorJS for automated testing of Angular 1.x/2.x applications
ProtractorJS for automated testing of Angular 1.x/2.x applications
 
Angles and Measuring (degrees quiz)
Angles and Measuring (degrees quiz)Angles and Measuring (degrees quiz)
Angles and Measuring (degrees quiz)
 
Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014Page Objects Done Right - selenium conference 2014
Page Objects Done Right - selenium conference 2014
 
Test Data - Food for your Test Automation Framework
Test Data - Food for your Test Automation FrameworkTest Data - Food for your Test Automation Framework
Test Data - Food for your Test Automation Framework
 
Sharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriverSharing (less) Pain of using Protractor & WebDriver
Sharing (less) Pain of using Protractor & WebDriver
 
Using a protractor
Using a protractorUsing a protractor
Using a protractor
 
MVC.net training in pune
MVC.net training in pune MVC.net training in pune
MVC.net training in pune
 
Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet Protractor Training in Pune by QuickITDotnet
Protractor Training in Pune by QuickITDotnet
 
Protractor Training - Online training On Skype
Protractor Training - Online training On Skype Protractor Training - Online training On Skype
Protractor Training - Online training On Skype
 
Protractor style guide - Agile Testers Conference 2016
Protractor style guide - Agile Testers Conference 2016Protractor style guide - Agile Testers Conference 2016
Protractor style guide - Agile Testers Conference 2016
 

Similar to Protractor: Tips & Tricks

Similar to Protractor: Tips & Tricks (20)

Automated Unit Testing and TDD
Automated Unit Testing and TDDAutomated Unit Testing and TDD
Automated Unit Testing and TDD
 
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd   seven years afterIan Cooper webinar for DDD Iran: Kent beck style tdd   seven years after
Ian Cooper webinar for DDD Iran: Kent beck style tdd seven years after
 
TLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing TestingTLC2018 Shyam Sunder: Legoizing Testing
TLC2018 Shyam Sunder: Legoizing Testing
 
Petri for kyiv.pptx
Petri for kyiv.pptxPetri for kyiv.pptx
Petri for kyiv.pptx
 
Auditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub RepositoriesAuditing Development Guidelines in GitHub Repositories
Auditing Development Guidelines in GitHub Repositories
 
Discover the power of browser developer tools
Discover the power of browser developer toolsDiscover the power of browser developer tools
Discover the power of browser developer tools
 
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
How are Discussions Associated with Bug Reworking? An Empirical Study on Open...
 
Writing Tests with the Unity Test Framework
Writing Tests with the Unity Test FrameworkWriting Tests with the Unity Test Framework
Writing Tests with the Unity Test Framework
 
Development and test infrastructure
Development and test infrastructureDevelopment and test infrastructure
Development and test infrastructure
 
Treating test code as production code
Treating test code as production codeTreating test code as production code
Treating test code as production code
 
That worked before
That worked beforeThat worked before
That worked before
 
Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)Unit testing (Exploring the other side as a tester)
Unit testing (Exploring the other side as a tester)
 
Making the Unstable Stable - An Intro To Testing
Making the Unstable Stable - An Intro To TestingMaking the Unstable Stable - An Intro To Testing
Making the Unstable Stable - An Intro To Testing
 
Is Groovy better for testing than Java?
Is Groovy better for testing than Java?Is Groovy better for testing than Java?
Is Groovy better for testing than Java?
 
midterm_fa08.pdf
midterm_fa08.pdfmidterm_fa08.pdf
midterm_fa08.pdf
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
 
5 reasons you'll love to hate Agile Development
5 reasons you'll love to hate Agile Development5 reasons you'll love to hate Agile Development
5 reasons you'll love to hate Agile Development
 
Best pratice
Best praticeBest pratice
Best pratice
 
Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023Getting Started with Test-Driven Development at Longhorn PHP 2023
Getting Started with Test-Driven Development at Longhorn PHP 2023
 
Mulesoft torronto meetup_16
Mulesoft torronto meetup_16Mulesoft torronto meetup_16
Mulesoft torronto meetup_16
 

More from Sergey Bolshchikov

More from Sergey Bolshchikov (14)

Onboarding for Software Engineers Done Right
Onboarding for Software Engineers Done RightOnboarding for Software Engineers Done Right
Onboarding for Software Engineers Done Right
 
Pragmatic React Workshop
Pragmatic React WorkshopPragmatic React Workshop
Pragmatic React Workshop
 
Microservices on the client side
Microservices on the client sideMicroservices on the client side
Microservices on the client side
 
ES2015 Quiz
ES2015 QuizES2015 Quiz
ES2015 Quiz
 
Talking code: How To
Talking code: How ToTalking code: How To
Talking code: How To
 
Values & Culture of Continuous Deliver
Values & Culture of Continuous DeliverValues & Culture of Continuous Deliver
Values & Culture of Continuous Deliver
 
Continuous Delivery for Front-End Engineers
Continuous Delivery for Front-End EngineersContinuous Delivery for Front-End Engineers
Continuous Delivery for Front-End Engineers
 
Зачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQueryЗачем нужен EmberJS, если мне хвататет jQuery
Зачем нужен EmberJS, если мне хвататет jQuery
 
Ember Reusable Components and Widgets
Ember Reusable Components and WidgetsEmber Reusable Components and Widgets
Ember Reusable Components and Widgets
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
Web Projects: From Theory To Practice
Web Projects: From Theory To PracticeWeb Projects: From Theory To Practice
Web Projects: From Theory To Practice
 
AngularJS Basics with Example
AngularJS Basics with ExampleAngularJS Basics with Example
AngularJS Basics with Example
 
Backbone Basics with Examples
Backbone Basics with ExamplesBackbone Basics with Examples
Backbone Basics with Examples
 
JS Single-Page Web App Essentials
JS Single-Page Web App EssentialsJS Single-Page Web App Essentials
JS Single-Page Web App Essentials
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Recently uploaded (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 

Protractor: Tips & Tricks