SlideShare a Scribd company logo
1 of 16
Download to read offline
Autom ation Best
Practices
L eo L a s k in , T es t Au t om a t ion Ad v is or
About Me
• Twitter: @LeoLaskin
• LinkedIn: https://www.linkedin.com/in/llaskin
• Email: leo@saucelabs.com
© Sauce Labs, Inc. 2
Manual Tests
© Sauce Labs, Inc. 3
No Manual Tests*
*	Testing	Extreme	Programming	 by	Lisa	Crispin	and	
Tip	House
Start with a Clean System
• Having a clean system every time is paramount for
reproducible results
• SaaS grid based systems can be setup to be fresh
with no system cache, browser cache, cookies, etc.
© Sauce Labs, Inc. 4
Parallelizatio n
• Serialized tests take more time and cost more
money
• Using a Selenium Grid like Sauce Labs,
parallelized tests can spin up multiple
browsers for you or multiple tests
simultaneously
• 300 minute long tests can take either 5 hours
or as little as 1 minute.
© Sauce Labs, Inc. 5
Page Object Pattern
• Encourage reusable code throughout your test app
• Test code more organized for update if test
parameters like selectors change
• Tests are more readable with a natural feeling
Domain-Specific Language(DSL)
© Sauce Labs, Inc. 6
Test Constantly
• Don’t ever stop testing
• Having tests run on every commit is going to provide
significantly higher confidence in your software
• You have unlimited amounts of time to test. Use it!
© Sauce Labs, Inc. 7
Speed things up
• The average attention span of an adult is less then 5
minutes
• Try to provide results before context is switched
• Make the devs work for you not against you
© Sauce Labs, Inc. 8
Start Small
• Don’t rush to automate every test case
• Identify test case priority then automate
• Don’t automate end-to-end
• Divide and conquer
© Sauce Labs, Inc. 9
Divide your testing up
• By Functional Area
• By hosted server
• By backend server
© Sauce Labs, Inc. 10
Automation = Development Activity
• Automation is a real development endeavor, treat it
as such
• Beware of Cowboy Coding
• Copy/Pasting inside your code can be replaced by
reusable methods
• Source control is cheap insurance
• Bad coding practices = bad testing practices (and
vice versa)
© Sauce Labs, Inc. 11
Don’t Forget to Wait!
• Web pages don’t load instantaneously, and not all
elements load at the same time
• A lot of your failures in finding an element will
disappear if you use these
• Explicit or fluent waits are preferred for waiting for
single elements
• Implicit waits for waiting all the time
• Fluent waits for elements that can take variable time
to load
© Sauce Labs, Inc. 12
Avoid Dependencies
• Don’t allow tests to be dependent on each other
• One test’s actions should not drive another tests
assertion criteria
© Sauce Labs, Inc. 13
Prep Your Environment
• Make sure your CI rig can handle the number of jobs
running on it simultaneously
• Make sure your SUT can handle the number of tests
running on it simultaneously
© Sauce Labs, Inc. 14
Collect Metrics
• How long did test runs take before and after
automation?
• How many bugs do automated tests identify per
release?
• How many engineers does a test run require?
© Sauce Labs, Inc. 15
SAUCE LABS RESOURCES
February 29, 2016 © Sauce Labs, Inc.
• Sign up for a free trial of Sauce
https://saucelabs.com/signup/trial
• Check out our docs on Automation and how to use
Sauce at https://wiki.saucelabs.com
16

More Related Content

What's hot

Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
SivaprasanthRentala1975
 
Best practices quality assurance
Best practices   quality assuranceBest practices   quality assurance
Best practices quality assurance
Shakal Shukla
 

What's hot (20)

Automation testing strategy, approach & planning
Automation testing  strategy, approach & planningAutomation testing  strategy, approach & planning
Automation testing strategy, approach & planning
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Unit Testing Concepts and Best Practices
Unit Testing Concepts and Best PracticesUnit Testing Concepts and Best Practices
Unit Testing Concepts and Best Practices
 
Test automation process
Test automation processTest automation process
Test automation process
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
QA Best Practices in Agile World_new
QA Best Practices in Agile World_newQA Best Practices in Agile World_new
QA Best Practices in Agile World_new
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Test automation proposal
Test automation proposalTest automation proposal
Test automation proposal
 
Agile Testing by Example
Agile Testing by ExampleAgile Testing by Example
Agile Testing by Example
 
Agile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated TestingAgile Testing Framework - The Art of Automated Testing
Agile Testing Framework - The Art of Automated Testing
 
Test Strategy
Test StrategyTest Strategy
Test Strategy
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Automation Testing
Automation TestingAutomation Testing
Automation Testing
 
Best practices quality assurance
Best practices   quality assuranceBest practices   quality assurance
Best practices quality assurance
 
Building a Test Automation Strategy for Success
Building a Test Automation Strategy for SuccessBuilding a Test Automation Strategy for Success
Building a Test Automation Strategy for Success
 
6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture6 Traits of a Successful Test Automation Architecture
6 Traits of a Successful Test Automation Architecture
 
Test Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.comTest Automation Framework Design | www.idexcel.com
Test Automation Framework Design | www.idexcel.com
 
JUnit & Mockito, first steps
JUnit & Mockito, first stepsJUnit & Mockito, first steps
JUnit & Mockito, first steps
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 

Viewers also liked

Viewers also liked (16)

Design Patterns for Scalable Test Automation With Selenium & WebdriverIO
Design Patterns for Scalable Test Automation With Selenium & WebdriverIODesign Patterns for Scalable Test Automation With Selenium & WebdriverIO
Design Patterns for Scalable Test Automation With Selenium & WebdriverIO
 
Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)Best Practices in Mobile CI (webinar)
Best Practices in Mobile CI (webinar)
 
Transitioning from Traditional to Modern QA
Transitioning from Traditional to Modern QATransitioning from Traditional to Modern QA
Transitioning from Traditional to Modern QA
 
Getting Started with Mobile Test Automation & Appium
Getting Started with Mobile Test Automation & AppiumGetting Started with Mobile Test Automation & Appium
Getting Started with Mobile Test Automation & Appium
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
 
Easy Continuous Deployment You Can Trust (Webinar)
Easy Continuous Deployment You Can Trust (Webinar)Easy Continuous Deployment You Can Trust (Webinar)
Easy Continuous Deployment You Can Trust (Webinar)
 
Testing Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS CurriculumTesting Code.org's Interactive CS Curriculum
Testing Code.org's Interactive CS Curriculum
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
 
Beyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms OrganizationsBeyond the Release: CI That Transforms Organizations
Beyond the Release: CI That Transforms Organizations
 
10 things you didnt know about appium + whats new in appium 1.5
10 things you didnt know about appium + whats new in appium 1.510 things you didnt know about appium + whats new in appium 1.5
10 things you didnt know about appium + whats new in appium 1.5
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Moving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life StoryMoving From a Selenium Grid to the Cloud - A Real Life Story
Moving From a Selenium Grid to the Cloud - A Real Life Story
 
How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)How To Use Selenium Successfully (Java Edition)
How To Use Selenium Successfully (Java Edition)
 
Sauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFSSauce Labs for Visual Studio Team Services & TFS
Sauce Labs for Visual Studio Team Services & TFS
 
10 Benefits of Automated Testing
10 Benefits of Automated Testing10 Benefits of Automated Testing
10 Benefits of Automated Testing
 

Similar to Automation Best Practices

Similar to Automation Best Practices (20)

Build Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with SeleniumBuild Fail-Proof Tests in Any Browser with Selenium
Build Fail-Proof Tests in Any Browser with Selenium
 
5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation5 Steps to Jump Start Your Test Automation
5 Steps to Jump Start Your Test Automation
 
Chaos Engineering - Limiting Damage During Chaos Experiments
Chaos Engineering - Limiting Damage During Chaos ExperimentsChaos Engineering - Limiting Damage During Chaos Experiments
Chaos Engineering - Limiting Damage During Chaos Experiments
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Load testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew SiemerLoad testing with Visual Studio and Azure - Andrew Siemer
Load testing with Visual Studio and Azure - Andrew Siemer
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
2016 - Fail Proof Ways to Run Beautiful Tests Regardless Of Browser Choice
 
Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure Zero to Test Driven Infrastructure
Zero to Test Driven Infrastructure
 
Getting Started With Selenium
Getting Started With SeleniumGetting Started With Selenium
Getting Started With Selenium
 
Mini-Training: Netflix Simian Army
Mini-Training: Netflix Simian ArmyMini-Training: Netflix Simian Army
Mini-Training: Netflix Simian Army
 
SauceCon 2017: Making Your Mobile App Automatable
SauceCon 2017: Making Your Mobile App AutomatableSauceCon 2017: Making Your Mobile App Automatable
SauceCon 2017: Making Your Mobile App Automatable
 
Continuous Integration Testing for SAP
Continuous Integration Testing for SAPContinuous Integration Testing for SAP
Continuous Integration Testing for SAP
 
How to make your functional tests really quick
How to make your functional tests really quickHow to make your functional tests really quick
How to make your functional tests really quick
 
Dev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teamsDev ops for mobile apps at microsoft teams
Dev ops for mobile apps at microsoft teams
 
Tdd using Jasmine and karma
Tdd using  Jasmine and karmaTdd using  Jasmine and karma
Tdd using Jasmine and karma
 
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdfTest Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
Test Automation using UiPath Test Suite - Developer Circle Part-3 - 07262022.pdf
 
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-54&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
4&5.pptx SOFTWARE TESTING UNIT-4 AND UNIT-5
 
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A CookbookJavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
JavaOne 2016 - CON3080 - Testing Java Web Applications with Selenium: A Cookbook
 
Testing for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration MondayTesting for Logic App Solutions | Integration Monday
Testing for Logic App Solutions | Integration Monday
 
Benefits from AATs
Benefits from AATsBenefits from AATs
Benefits from AATs
 

More from Sauce Labs

Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
Sauce Labs
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
Sauce Labs
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
Sauce Labs
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
Sauce Labs
 

More from Sauce Labs (20)

Simplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless ToolsSimplify Salesforce Testing with AI-Driven Codeless Tools
Simplify Salesforce Testing with AI-Driven Codeless Tools
 
Testing on Mobile Devices with Location Services
Testing on Mobile Devices with Location ServicesTesting on Mobile Devices with Location Services
Testing on Mobile Devices with Location Services
 
Your Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at ScaleYour Framework for Success: introduction to JavaScript Testing at Scale
Your Framework for Success: introduction to JavaScript Testing at Scale
 
Automating Hybrid Applications with Appium
Automating Hybrid Applications with AppiumAutomating Hybrid Applications with Appium
Automating Hybrid Applications with Appium
 
Quality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI TestingQuality at Speed: More API Testing, Less UI Testing
Quality at Speed: More API Testing, Less UI Testing
 
Creating Digital Confidence with Test Automation
Creating Digital Confidence with Test AutomationCreating Digital Confidence with Test Automation
Creating Digital Confidence with Test Automation
 
Just Enough (Automated) Testing
Just Enough (Automated) TestingJust Enough (Automated) Testing
Just Enough (Automated) Testing
 
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium TestsUsing Axe to Add Accessibility Checks to Your Existing Selenium Tests
Using Axe to Add Accessibility Checks to Your Existing Selenium Tests
 
How Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product ObsessionHow Open Source Helps to Bring Back Product Obsession
How Open Source Helps to Bring Back Product Obsession
 
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon StewartWebinar: A Sneak Peek at Selenium 4 with Simon Stewart
Webinar: A Sneak Peek at Selenium 4 with Simon Stewart
 
[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io[Deu] Test Automatisierung Mit Web Driver.io
[Deu] Test Automatisierung Mit Web Driver.io
 
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
Accelerating Innovation: Leveraging Open Source to Optimize Your Shift-Left I...
 
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. ForresterAccelerating Your Digital Agenda with Continuous Testing ft. Forrester
Accelerating Your Digital Agenda with Continuous Testing ft. Forrester
 
How to Measure Success in Continuous Testing
How to Measure Success in Continuous TestingHow to Measure Success in Continuous Testing
How to Measure Success in Continuous Testing
 
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
From Zero to 2.7 Million - How Verizon Media Embraced Open Source to Accelera...
 
Sauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software TestingSauce Labs Webinar: Rising Importance of Software Testing
Sauce Labs Webinar: Rising Importance of Software Testing
 
BDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu PetetiBDD With Selenide by Hima Bindu Peteti
BDD With Selenide by Hima Bindu Peteti
 
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
Closer To the Metal - Why and How We Use XCTest and Espresso by Mario Negro P...
 
Continuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa BenuaContinuous Delivery for "Mature" Codebases by Melisa Benua
Continuous Delivery for "Mature" Codebases by Melisa Benua
 
Building Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny BrambleBuilding Automation Engineers From Scratch by Jenny Bramble
Building Automation Engineers From Scratch by Jenny Bramble
 

Recently uploaded

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Automation Best Practices

  • 1. Autom ation Best Practices L eo L a s k in , T es t Au t om a t ion Ad v is or
  • 2. About Me • Twitter: @LeoLaskin • LinkedIn: https://www.linkedin.com/in/llaskin • Email: leo@saucelabs.com © Sauce Labs, Inc. 2
  • 3. Manual Tests © Sauce Labs, Inc. 3 No Manual Tests* * Testing Extreme Programming by Lisa Crispin and Tip House
  • 4. Start with a Clean System • Having a clean system every time is paramount for reproducible results • SaaS grid based systems can be setup to be fresh with no system cache, browser cache, cookies, etc. © Sauce Labs, Inc. 4
  • 5. Parallelizatio n • Serialized tests take more time and cost more money • Using a Selenium Grid like Sauce Labs, parallelized tests can spin up multiple browsers for you or multiple tests simultaneously • 300 minute long tests can take either 5 hours or as little as 1 minute. © Sauce Labs, Inc. 5
  • 6. Page Object Pattern • Encourage reusable code throughout your test app • Test code more organized for update if test parameters like selectors change • Tests are more readable with a natural feeling Domain-Specific Language(DSL) © Sauce Labs, Inc. 6
  • 7. Test Constantly • Don’t ever stop testing • Having tests run on every commit is going to provide significantly higher confidence in your software • You have unlimited amounts of time to test. Use it! © Sauce Labs, Inc. 7
  • 8. Speed things up • The average attention span of an adult is less then 5 minutes • Try to provide results before context is switched • Make the devs work for you not against you © Sauce Labs, Inc. 8
  • 9. Start Small • Don’t rush to automate every test case • Identify test case priority then automate • Don’t automate end-to-end • Divide and conquer © Sauce Labs, Inc. 9
  • 10. Divide your testing up • By Functional Area • By hosted server • By backend server © Sauce Labs, Inc. 10
  • 11. Automation = Development Activity • Automation is a real development endeavor, treat it as such • Beware of Cowboy Coding • Copy/Pasting inside your code can be replaced by reusable methods • Source control is cheap insurance • Bad coding practices = bad testing practices (and vice versa) © Sauce Labs, Inc. 11
  • 12. Don’t Forget to Wait! • Web pages don’t load instantaneously, and not all elements load at the same time • A lot of your failures in finding an element will disappear if you use these • Explicit or fluent waits are preferred for waiting for single elements • Implicit waits for waiting all the time • Fluent waits for elements that can take variable time to load © Sauce Labs, Inc. 12
  • 13. Avoid Dependencies • Don’t allow tests to be dependent on each other • One test’s actions should not drive another tests assertion criteria © Sauce Labs, Inc. 13
  • 14. Prep Your Environment • Make sure your CI rig can handle the number of jobs running on it simultaneously • Make sure your SUT can handle the number of tests running on it simultaneously © Sauce Labs, Inc. 14
  • 15. Collect Metrics • How long did test runs take before and after automation? • How many bugs do automated tests identify per release? • How many engineers does a test run require? © Sauce Labs, Inc. 15
  • 16. SAUCE LABS RESOURCES February 29, 2016 © Sauce Labs, Inc. • Sign up for a free trial of Sauce https://saucelabs.com/signup/trial • Check out our docs on Automation and how to use Sauce at https://wiki.saucelabs.com 16