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

Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
basma_iti_1984
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
tharindakasun
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
Keytorc Software Testing Services
 

What's hot (20)

Functional to Visual: AI-powered UI Testing from Testim and Applitools
Functional to Visual: AI-powered UI Testing from Testim and ApplitoolsFunctional to Visual: AI-powered UI Testing from Testim and Applitools
Functional to Visual: AI-powered UI Testing from Testim and Applitools
 
Automated Testing with Agile
Automated Testing with AgileAutomated Testing with Agile
Automated Testing with Agile
 
Test Automation in Agile
Test Automation in AgileTest Automation in Agile
Test Automation in Agile
 
API Testing With Katalon Studio
API Testing With Katalon StudioAPI Testing With Katalon Studio
API Testing With Katalon Studio
 
Test Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For SucesssTest Automation: A Roadmap For Sucesss
Test Automation: A Roadmap For Sucesss
 
Automation testing introduction for FujiNet
Automation testing introduction for FujiNetAutomation testing introduction for FujiNet
Automation testing introduction for FujiNet
 
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
 
Best practices for test automation
Best practices for test automationBest practices for test automation
Best practices for test automation
 
Test Automation Strategies For Agile
Test Automation Strategies For AgileTest Automation Strategies For Agile
Test Automation Strategies For Agile
 
Testing Tool Evaluation Criteria
Testing Tool Evaluation CriteriaTesting Tool Evaluation Criteria
Testing Tool Evaluation Criteria
 
Need for automation testing
Need for automation testingNeed for automation testing
Need for automation testing
 
Test automation process
Test automation processTest automation process
Test automation process
 
How to select the right automated testing tool
How to select the right automated testing toolHow to select the right automated testing tool
How to select the right automated testing tool
 
Test automation
Test automationTest automation
Test automation
 
Test automation within a scrum process
Test automation within a scrum processTest automation within a scrum process
Test automation within a scrum process
 
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
 
Introduction to Software Test Automation
Introduction to Software Test AutomationIntroduction to Software Test Automation
Introduction to Software Test Automation
 
Automated vs manual testing
Automated vs manual testingAutomated vs manual testing
Automated vs manual testing
 
Agile Testing Strategy
Agile Testing StrategyAgile Testing Strategy
Agile Testing Strategy
 
Test Automation - Keytorc Approach
Test Automation - Keytorc Approach Test Automation - Keytorc Approach
Test Automation - Keytorc Approach
 

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

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
Quantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation ComputingQuantum Leap in Next-Generation Computing
Quantum Leap in Next-Generation Computing
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 

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