SlideShare a Scribd company logo
1 of 27
Download to read offline
How To Grade Your
Selenium Tests
http://se.tips/getting-started-talk
http://se.tips/selenium-tips
http://se.tips/selenium-book
Letโ€™s talk about tests
What Makes a Bad Test?
โ€ข Fails For No Good Reason
โ€ข Changes in AUT, Need to Update Test(s)
โ€ข Slow
โ€ข Unreliable
โ€ข Hard to Understand and Maintain
What Makes a Good Test?
โ€ข Written for BDD or xUnit test framework
โ€ข Test one thing (atomic)
โ€ข Each test can be run independently (autonomous)
โ€ข Anyone can understand what it is doing
โ€ข Group similar tests together
โ€ข Centralized setup/teardown
โ€ข Uses Page Objects
A Testing Rubric
(Each test starts with 100 points, deduct as necessary)
Item Belong in tests? Score
Selenium Commands No -3 per (max of -9)
Locators No -2 per (max of -8)
Selenium setup/teardown* No -20
Hard-coded sleeps No -5 per (max of -20)
Implicit wait calls No -10
Explicit Wait calls No -3
Conditionals No -5 (max of -20)
Calls to Page Objects Yes N/A
Assertion(s)* Yes N/A
Letโ€™s talk about
Page Objects
http://martinfowler.com/bliki/PageObject.html
What Makes a Bad PO?
โ€ข Gigantic in size (e.g., hundreds or thousands of
lines in code)
โ€ข Over-reaching responsibility
โ€ข Contain overly complicated logic
โ€ข Return not enough or too much information to the
test (leaky abstraction)
โ€ข Assertions happening in the PO instead of the test
What Makes a Good PO?
โ€ข Contains State (e.g., locators)
โ€ข Contains Behavior (e.g., methods to interact with
the page)
โ€ข Returns some information about the page (e.g.,
new page object, text from the page, a boolean
result for some check, etc. โ€” never a WebElement)
โ€ข Veri๏ฌes page ready state as part of initialization
with a found Element
A Page Object Rubric
(Each Page Object starts with 100, deduct points as necessary)
Item Belong in POs? Score
> 200 lines of code No -5 per 50 lines over
Assertions No* -5 per (max of -20)
Hard-coded sleeps No -5 per (max of -20)
Implicit wait calls No -10
Explicit waits Yes N/A
Verify page ready state* Yes -8 if not verifying an
element
Locators* Yes N/A
http://se.tips/se-waiting-jim-evans
Letโ€™s talk about locators
Locator Strategies
โ€ข Class
โ€ข CSS selectors
โ€ข ID
โ€ข Link Text
โ€ข Partial Link Text
โ€ข Tag Name
โ€ข XPath
Good locators are:
โ€ข unique
โ€ข descriptive
โ€ข unlikely to change
That rules a few of these out
Locator Strategies
โ€ข Class
โ€ข CSS selectors
โ€ข ID
โ€ข Link Text
โ€ข Partial Link Text
โ€ข Tag Name
โ€ข XPath
Good locators are:
โ€ข unique
โ€ข descriptive
โ€ข unlikely to change
That rules a few of these out
Locator Strategies
โ€ข Class
โ€ข CSS selectors
โ€ข ID
โ€ข Link Text
โ€ข Partial Link Text
โ€ข Tag Name
โ€ข XPath
Good locators are:
โ€ข unique
โ€ข descriptive
โ€ข unlikely to change
That rules a few of these out
Start with IDs and Classes
Locator Strategies
โ€ข Class
โ€ข CSS selectors
โ€ข ID
โ€ข Link Text
โ€ข Partial Link Text
โ€ข Tag Name
โ€ข XPath
Good locators are:
โ€ข unique
โ€ข descriptive
โ€ข unlikely to change
That rules a few of these out
Start with IDs and Classes
Use CSS or XPath (with care)
Which is better
CSS or XPath?
CSS vs. XPath
Benchmarks
http://se.tips/se-benchmarks
A Locator Rubric
(Each locator gets a grade)
Item Letter Grade E.g.,
Dynamic locators D-
User account speci๏ฌc
or tied to page render
Tied to page layout D
XPath: / / /
CSS: > > >, etc.
Text on the page C Link text, page copy
Reasonable traversal B
Parent to child w/in an
element node
Using semantic name B+
Input labels
(name='username')
Semantic ID A
Unique, descriptive,
unlikely to change
Non-unique locator? -2 full letter grades
Soโ€ฆ
Whatโ€™s your testing GPA?
Topic Weight
Tests 20%
Page Objects 30%
Locators 50%
Available in Java, JavaScript, Python, Ruby, and C#
25% OFF until Friday at midnight (Eastern)
https://seleniumguidebook.com

More Related Content

What's hot

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
ย 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
onlinemindq
ย 
PhpUnit & web driver
PhpUnit & web driverPhpUnit & web driver
PhpUnit & web driver
Manish Trivedi
ย 
[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)

Selenium Frameworks
Selenium FrameworksSelenium Frameworks
Selenium Frameworks
ย 
Selenium Best Practices with Jason Huggins
Selenium Best Practices with Jason HugginsSelenium Best Practices with Jason Huggins
Selenium Best Practices with Jason Huggins
ย 
Practical Tips & Tricks for Selenium Test Automation
Practical Tips & Tricks for Selenium Test AutomationPractical Tips & Tricks for Selenium Test Automation
Practical Tips & Tricks for Selenium Test Automation
ย 
How to Use Selenium, Successfully
How to Use Selenium, SuccessfullyHow to Use Selenium, Successfully
How to Use Selenium, Successfully
ย 
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...
ย 
Selenium (2)
Selenium (2)Selenium (2)
Selenium (2)
ย 
PhpUnit & web driver
PhpUnit & web driverPhpUnit & web driver
PhpUnit & web driver
ย 
Selenium and The Grinder
Selenium and The GrinderSelenium and The Grinder
Selenium and The Grinder
ย 
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
ย 
Selenium Users Anonymous
Selenium Users AnonymousSelenium Users Anonymous
Selenium Users Anonymous
ย 
Introduction to jest
Introduction to jestIntroduction to jest
Introduction to jest
ย 
Selenium 101
Selenium 101Selenium 101
Selenium 101
ย 
Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018Jest: Frontend Testing leicht gemacht @EnterJS2018
Jest: Frontend Testing leicht gemacht @EnterJS2018
ย 
[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...
ย 
How To Find Information On Your Own
How To Find Information On Your OwnHow To Find Information On Your Own
How To Find Information On Your Own
ย 
Selenium Design Patterns
Selenium Design PatternsSelenium Design Patterns
Selenium Design Patterns
ย 
Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)Software testing with examples in Angular (and AngularJS)
Software testing with examples in Angular (and AngularJS)
ย 
Selenium testing IDE 101
Selenium testing IDE 101Selenium testing IDE 101
Selenium testing IDE 101
ย 
Automated Software Testing
Automated Software TestingAutomated Software Testing
Automated Software Testing
ย 
Brace yourself from automation death trap
Brace yourself from automation death trapBrace yourself from automation death trap
Brace yourself from automation death trap
ย 

Viewers also liked

Selenium 1july
Selenium 1julySelenium 1july
Selenium 1july
Edureka!
ย 

Viewers also liked (20)

Managers, Future Proof Your Automation
Managers, Future Proof Your AutomationManagers, Future Proof Your Automation
Managers, Future Proof Your Automation
ย 
Appium: Prime Cuts
Appium: Prime CutsAppium: Prime Cuts
Appium: Prime Cuts
ย 
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
Tests for Every Branch Using CircleCI and Sauce Labs to Continuously Test CS ...
ย 
The Journey to Devops: From Waterfall to Continuous Integration
The Journey to Devops: From Waterfall to Continuous IntegrationThe Journey to Devops: From Waterfall to Continuous Integration
The Journey to Devops: From Waterfall to Continuous Integration
ย 
Continuous Testing of eCommerce Apps
Continuous Testing of eCommerce AppsContinuous Testing of eCommerce Apps
Continuous Testing of eCommerce Apps
ย 
Test Automation In The Hands of "The Business"
Test Automation In The Hands of "The Business"Test Automation In The Hands of "The Business"
Test Automation In The Hands of "The Business"
ย 
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeterCombining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeter
ย 
Automation Best Practices
Automation Best PracticesAutomation Best Practices
Automation Best Practices
ย 
Deployment automation framework with selenium
Deployment automation framework with seleniumDeployment automation framework with selenium
Deployment automation framework with selenium
ย 
How to work with Selenium Grid: a quick walkthrough
How to work with Selenium Grid: a quick walkthroughHow to work with Selenium Grid: a quick walkthrough
How to work with Selenium Grid: a quick walkthrough
ย 
Selenium 1july
Selenium 1julySelenium 1july
Selenium 1july
ย 
Improve Customer Experiences With Big Data #DataTalk
Improve Customer Experiences With Big Data #DataTalkImprove Customer Experiences With Big Data #DataTalk
Improve Customer Experiences With Big Data #DataTalk
ย 
7 Deadly Sins of Agile Software Test Automation
7 Deadly Sins of Agile Software Test Automation7 Deadly Sins of Agile Software Test Automation
7 Deadly Sins of Agile Software Test Automation
ย 
How To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium GridHow To Add Any Feature To Your Selenium Grid
How To Add Any Feature To Your Selenium Grid
ย 
Transitioning from Traditional to Modern QA
Transitioning from Traditional to Modern QATransitioning from Traditional to Modern QA
Transitioning from Traditional to Modern QA
ย 
Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium Data driven Automation Framework with Selenium
Data driven Automation Framework with Selenium
ย 
Big Data Platform at Pinterest
Big Data Platform at PinterestBig Data Platform at Pinterest
Big Data Platform at Pinterest
ย 
Designing keyword and Data Driven Automation framework with Selenium
Designing keyword and Data Driven Automation framework with SeleniumDesigning keyword and Data Driven Automation framework with Selenium
Designing keyword and Data Driven Automation framework with Selenium
ย 
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
ย 
Selenium Automation Framework
Selenium Automation  FrameworkSelenium Automation  Framework
Selenium Automation Framework
ย 

Similar to How To Grade Your Selenium Tests by Dave Haeffner - Sauce Labs Webinar

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)
Dave Haeffner
ย 
Unit Testing
Unit TestingUnit Testing
Unit Testing
Adam Birr
ย 
Practical unit testing 2014
Practical unit testing 2014Practical unit testing 2014
Practical unit testing 2014
Andrew Fray
ย 
Testing gone-right
Testing gone-rightTesting gone-right
Testing gone-right
Jesse Wolgamott
ย 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert days
Oren Rubin
ย 

Similar to How To Grade Your Selenium Tests by Dave Haeffner - Sauce Labs Webinar (20)

Grading the Quality of Selenium Tests
Grading the Quality of Selenium TestsGrading the Quality of Selenium Tests
Grading the Quality of Selenium Tests
ย 
How to use selenium successfully
How to use selenium successfullyHow to use selenium successfully
How to use selenium successfully
ย 
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)
ย 
Futureproofing REST APIs
Futureproofing REST APIsFutureproofing REST APIs
Futureproofing REST APIs
ย 
Unit Testing
Unit TestingUnit Testing
Unit Testing
ย 
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)
ย 
Shift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David LaulusaShift-Left Testing: QA in a DevOps World by David Laulusa
Shift-Left Testing: QA in a DevOps World by David Laulusa
ย 
SQL Server Worst Practices - EN
SQL Server Worst Practices - ENSQL Server Worst Practices - EN
SQL Server Worst Practices - EN
ย 
Practical unit testing 2014
Practical unit testing 2014Practical unit testing 2014
Practical unit testing 2014
ย 
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
Unit Testing and Behavior Driven Testing with AngularJS - Jesse Liberty | Fal...
ย 
Unit testing
Unit testingUnit testing
Unit testing
ย 
Transformation Priority Premise: TDD Test Order Matters
Transformation Priority Premise: TDD Test Order MattersTransformation Priority Premise: TDD Test Order Matters
Transformation Priority Premise: TDD Test Order Matters
ย 
Awesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave HaeffnerAwesome Test Automation Made Simple w/ Dave Haeffner
Awesome Test Automation Made Simple w/ Dave Haeffner
ย 
Testing gone-right
Testing gone-rightTesting gone-right
Testing gone-right
ย 
Test automation expert days
Test automation   expert daysTest automation   expert days
Test automation expert days
ย 
Ruin your life using robot framework
Ruin your life using robot frameworkRuin your life using robot framework
Ruin your life using robot framework
ย 
Writing Better Tests - Applying Clean-Code TDD at 99designs
Writing Better Tests - Applying Clean-Code TDD at 99designsWriting Better Tests - Applying Clean-Code TDD at 99designs
Writing Better Tests - Applying Clean-Code TDD at 99designs
ย 
Tackling Testing Telephony
Tackling Testing Telephony Tackling Testing Telephony
Tackling Testing Telephony
ย 
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedInML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ML Platform 2018 Q2 Meetup - Search Relevance Debugging at LinkedIn
ย 
Say Goodbye to Flaky Selenium Tests
Say Goodbye to Flaky Selenium TestsSay Goodbye to Flaky Selenium Tests
Say Goodbye to Flaky Selenium Tests
ย 

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...
ย 
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
ย 
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
ย 

Recently uploaded

Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Chandigarh Call girls 9053900678 Call girls in Chandigarh
ย 
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRLLucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
imonikaupta
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
SUHANI PANDEY
ย 
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
ย 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
singhpriety023
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
SUHANI PANDEY
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
SUHANI PANDEY
ย 
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
nilamkumrai
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
SUHANI PANDEY
ย 

Recently uploaded (20)

Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐ŸฅตLow Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
Low Sexy Call Girls In Mohali 9053900678 ๐ŸฅตHave Save And Good Place ๐Ÿฅต
ย 
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRLLucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
Lucknow โคCALL GIRL 88759*99948 โคCALL GIRLS IN Lucknow ESCORT SERVICEโคCALL GIRL
ย 
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
VIP Model Call Girls NIBM ( Pune ) Call ON 8005736733 Starting From 5K to 25K...
ย 
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service โ˜Ž๏ธ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
ย 
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
20240509 QFM015 Engineering Leadership Reading List April 2024.pdf
ย 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
ย 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
ย 
Al Barsha Night Partner +0567686026 Call Girls Dubai
Al Barsha Night Partner +0567686026 Call Girls  DubaiAl Barsha Night Partner +0567686026 Call Girls  Dubai
Al Barsha Night Partner +0567686026 Call Girls Dubai
ย 
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts ServiceReal Escorts in Al Nahda +971524965298 Dubai Escorts Service
Real Escorts in Al Nahda +971524965298 Dubai Escorts Service
ย 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
ย 
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...Pune Airport ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready...
Pune Airport ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready...
ย 
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
20240510 QFM016 Irresponsible AI Reading List April 2024.pdf
ย 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
ย 
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
Ganeshkhind ! Call Girls Pune - 450+ Call Girl Cash Payment 8005736733 Neha T...
ย 
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
Shikrapur - Call Girls in Pune Neha 8005736733 | 100% Gennuine High Class Ind...
ย 
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
( Pune ) VIP Pimpri Chinchwad Call Girls ๐ŸŽ—๏ธ 9352988975 Sizzling | Escorts | G...
ย 
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
Hireโ† Young Call Girls in Tilak nagar (Delhi) โ˜Ž๏ธ 9205541914 โ˜Ž๏ธ Independent Esc...
ย 
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls DubaiDubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
Dubai=Desi Dubai Call Girls O525547819 Outdoor Call Girls Dubai
ย 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
ย 
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
Wagholi & High Class Call Girls Pune Neha 8005736733 | 100% Gennuine High Cla...
ย 

How To Grade Your Selenium Tests by Dave Haeffner - Sauce Labs Webinar

  • 1. How To Grade Your Selenium Tests
  • 4. What Makes a Bad Test? โ€ข Fails For No Good Reason โ€ข Changes in AUT, Need to Update Test(s) โ€ข Slow โ€ข Unreliable โ€ข Hard to Understand and Maintain
  • 5. What Makes a Good Test? โ€ข Written for BDD or xUnit test framework โ€ข Test one thing (atomic) โ€ข Each test can be run independently (autonomous) โ€ข Anyone can understand what it is doing โ€ข Group similar tests together โ€ข Centralized setup/teardown โ€ข Uses Page Objects
  • 6. A Testing Rubric (Each test starts with 100 points, deduct as necessary) Item Belong in tests? Score Selenium Commands No -3 per (max of -9) Locators No -2 per (max of -8) Selenium setup/teardown* No -20 Hard-coded sleeps No -5 per (max of -20) Implicit wait calls No -10 Explicit Wait calls No -3 Conditionals No -5 (max of -20) Calls to Page Objects Yes N/A Assertion(s)* Yes N/A
  • 9. What Makes a Bad PO? โ€ข Gigantic in size (e.g., hundreds or thousands of lines in code) โ€ข Over-reaching responsibility โ€ข Contain overly complicated logic โ€ข Return not enough or too much information to the test (leaky abstraction) โ€ข Assertions happening in the PO instead of the test
  • 10. What Makes a Good PO? โ€ข Contains State (e.g., locators) โ€ข Contains Behavior (e.g., methods to interact with the page) โ€ข Returns some information about the page (e.g., new page object, text from the page, a boolean result for some check, etc. โ€” never a WebElement) โ€ข Veri๏ฌes page ready state as part of initialization with a found Element
  • 11. A Page Object Rubric (Each Page Object starts with 100, deduct points as necessary) Item Belong in POs? Score > 200 lines of code No -5 per 50 lines over Assertions No* -5 per (max of -20) Hard-coded sleeps No -5 per (max of -20) Implicit wait calls No -10 Explicit waits Yes N/A Verify page ready state* Yes -8 if not verifying an element Locators* Yes N/A http://se.tips/se-waiting-jim-evans
  • 13. Locator Strategies โ€ข Class โ€ข CSS selectors โ€ข ID โ€ข Link Text โ€ข Partial Link Text โ€ข Tag Name โ€ข XPath Good locators are: โ€ข unique โ€ข descriptive โ€ข unlikely to change That rules a few of these out
  • 14. Locator Strategies โ€ข Class โ€ข CSS selectors โ€ข ID โ€ข Link Text โ€ข Partial Link Text โ€ข Tag Name โ€ข XPath Good locators are: โ€ข unique โ€ข descriptive โ€ข unlikely to change That rules a few of these out
  • 15. Locator Strategies โ€ข Class โ€ข CSS selectors โ€ข ID โ€ข Link Text โ€ข Partial Link Text โ€ข Tag Name โ€ข XPath Good locators are: โ€ข unique โ€ข descriptive โ€ข unlikely to change That rules a few of these out Start with IDs and Classes
  • 16. Locator Strategies โ€ข Class โ€ข CSS selectors โ€ข ID โ€ข Link Text โ€ข Partial Link Text โ€ข Tag Name โ€ข XPath Good locators are: โ€ข unique โ€ข descriptive โ€ข unlikely to change That rules a few of these out Start with IDs and Classes Use CSS or XPath (with care)
  • 17. Which is better CSS or XPath?
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 24. A Locator Rubric (Each locator gets a grade) Item Letter Grade E.g., Dynamic locators D- User account speci๏ฌc or tied to page render Tied to page layout D XPath: / / / CSS: > > >, etc. Text on the page C Link text, page copy Reasonable traversal B Parent to child w/in an element node Using semantic name B+ Input labels (name='username') Semantic ID A Unique, descriptive, unlikely to change Non-unique locator? -2 full letter grades
  • 26. Whatโ€™s your testing GPA? Topic Weight Tests 20% Page Objects 30% Locators 50%
  • 27. Available in Java, JavaScript, Python, Ruby, and C# 25% OFF until Friday at midnight (Eastern) https://seleniumguidebook.com