SlideShare a Scribd company logo
PAGE OBJECTS
THE GOOD, THE BAD, AND THE UGLY
WHO AM I?
• DAWN CODE, INDESCRIBABLE!
• COMP SCI DEGREE FROM CLEMSON, 2001
• TESTER -> PROGRAMMER -> TESTER
• LIFELONG LEARNER
• MACHINE LEARNER
• CURRENTLY QUALITY ENGINEERING MANAGER AT IBM WATSON HEALTH CLINICAL
DEVELOPMENT
IS TEST AUTOMATION CODE REAL CODE?
SHOULD AUTOMATION CODE BE WRITTEN FOLLOWING THE SAME CONVENTIONS
AS PRODUCTION DEVELOPERS WRITING PRODUCTION CODE?
CERTAINLY NOT?
DOES THAT MEAN WE SHOULD IGNORE
ALL CLEAN CODING PRACTICES?
OF COURSE NOT
THE HAPPY MEDIUM
• NO NEED TO GET INTO DEEP, TECHNICAL, PROGRAMMING CONCEPTS
• ALSO WE DO NOT WANT TO END UP WITH A PROJECT THAT COSTS MORE TO
MAINTAIN THAN IT IS WORTH TO EXECUTE
• TESTERS CAN START WITH SOME SMALL PRACTICES THAT WORK TOWARD
CLEAN, MAINTAINABLE, CODE
MAKE CODE HUMAN READABLE
• CODE IS READ BY HUMANS, NOT
COMPUTERS
• CODE SHOULD CONVEY INTENT
• NAMES SHOULD BE MEANINGFUL
• NAMES SHOULD NOT BE ABBREVIATED
Page objects: the good, the bad, the ugly
HOW COULD WE MODIFY THIS?
MAYBE LIKE THIS?
DRY: DON’T REPEAT YOURSELF
• IF YOU FIND THAT YOU DO IT MORE THAN ONCE, PULL IT OUT INTO A SEPARATE
METHOD
• IF YOU FIND THAT YOU ARE COPYING AND PASTING CODE, CONSIDER HOW
MUCH YOU ARE REPEATING YOURSELF
WHAT HAPPENS THE NEXT TIME WE WANT TO
OPEN THAT EXCEL SPREADSHEET?
Page objects: the good, the bad, the ugly
WHAT ABOUT WHEN ANOTHER USER
NEEDS TO PUT THEIR OWN PATH IN?
Page objects: the good, the bad, the ugly
WHAT ABOUT WHEN WE NEED TO INSERT
A SHEET AS SHEET 1 IN THESE EXCEL
FILES?
Page objects: the good, the bad, the ugly
EVEN BETTER …
CLEAN CODE FOR TESTERS
• NAME ALL VALUES WITH MEANINGFUL, RELEVANT, HUMAN-READABLE NAMES
• DON’T REPEAT YOURSELF
GET STARTED WITH SELENIUM
• HTTP://WWW.SELENIUMHQ.ORG/DOCS/03_WEBDRIVER.JSP
Page objects: the good, the bad, the ugly
IN THIS MODEL …
https://udayhere.files.wordpress.com/2012/06/testautomation1.jpg
WHAT DO WE INTEND TO MODEL?
MAYBE MORE LIKE THIS?
Page objects: the good, the bad, the ugly
WHY USE PAGE OBJECTS?
• CLEAN SEPARATION BETWEEN TEST CODE AND PAGE SPECIFIC CODE
• REDUCE/REMOVE DUPLICATION FOR OBJECT LOCATION AND INTERACTION
• TEST STEPS HAVE MORE MEANINGFUL NAMES ABOUT WHAT THE TEST IS
ACTUALLY DOING
PAGE OBJECT PATTERNS
• GROWING PAGE OBJECTS ORGANICALLY
• SELF-VERIFICATION
• BUILT-IN NAVIGATION
• NO ASSERTIONS IN THE PAGE OBJECT
• PRIVATE ELEMENTS IN PAGE OBJECT
WHAT GOES WRONG?
• MOST OF IT IS ABOUT SCALING
• FIRST: WHAT IS A “PAGE”, ANYWAY?
• LARGE AND COMPLEX PAGE OBJECTS
• NAVIGATION?
• IT DOES REQUIRE HIGHER LEVEL OF PROGRAMMING KNOWLEDGE
• PAGE OBJECT REPO IS HIGHLY APPLICATION SPECIFIC
WHAT ARE YOUR EXPERIENCES?
FOR FURTHER READING
• WRITING MAINTAINABLE AUTOMATED TESTS, BY DALE EMERY
• HTTPS://MARTINFOWLER.COM/BLIKI/PAGEOBJECT.HTML
• HTTPS://GITHUB.COM/SELENIUMHQ/SELENIUM/WIKI/PAGEOBJECTS
• HTTP://WWW.SELENIUMHQ.ORG/DOCS/06_TEST_DESIGN_CONSIDERATIONS.JSP

More Related Content

PDF
Online Tools to Monitor Competition - Do not re-invent the wheel
PDF
A Software Career (2017)
PDF
5 Practices for Better, Cheaper, Faster Service Delivery
PPTX
The shift left strategy
PDF
Product Development at Flood IO
PDF
MVP, You keep using that word. I don't think it means what you think it does
PPTX
What the VLF
PDF
Bootstrapping your startup & building it lean: stop wasting time
Online Tools to Monitor Competition - Do not re-invent the wheel
A Software Career (2017)
5 Practices for Better, Cheaper, Faster Service Delivery
The shift left strategy
Product Development at Flood IO
MVP, You keep using that word. I don't think it means what you think it does
What the VLF
Bootstrapping your startup & building it lean: stop wasting time

What's hot (7)

PPTX
SQL Phone Home: Teaching Your SQL Servers to Call for Help
PPTX
A Second Set Of Eyes: Getting The Most From Code Reviews
PPT
Geo Tag Symbian Signed
PPTX
Do More With Less: SQL Central Management Server and Multi-Server Administration
PPTX
DevOps and the Bottom Line
PPTX
What is good code?
PPTX
SharePoint Summit 2013 - Vancouver - MS Access 2013 - The new (old) thing
SQL Phone Home: Teaching Your SQL Servers to Call for Help
A Second Set Of Eyes: Getting The Most From Code Reviews
Geo Tag Symbian Signed
Do More With Less: SQL Central Management Server and Multi-Server Administration
DevOps and the Bottom Line
What is good code?
SharePoint Summit 2013 - Vancouver - MS Access 2013 - The new (old) thing
Ad

Similar to Page objects: the good, the bad, the ugly (20)

PDF
Patterns of a "Good" Test Automation Framework, Locators & Data
PDF
Patterns in Test Automation
PPTX
Writing Maintainable Test Automation
PDF
Perils of Page-Object Pattern
PDF
Patterns of a “good” test automation framework
PDF
Patterns of Test Automation
PPTX
Automated UI Testing Done Right (QMSDNUG)
PDF
PageObject
PPTX
Sustainable Automation Frameworks by Kelsey Shannahan
PPTX
Automated UI testing done right (DDDSydney)
PDF
Design Patterns for QA Automation
PDF
Agile Test Automation Anti-patterns and Rescue Strategies
PDF
Selenium Deep Dive
PDF
Automation Abstractions: Page Objects and Beyond
PDF
Clean Code
PDF
Page Objects - You're Doing it Wrong by Titus Fortner
KEY
Testing smells
PPT
Coding Standards
PDF
PPTX
Selenium Design Patterns
Patterns of a "Good" Test Automation Framework, Locators & Data
Patterns in Test Automation
Writing Maintainable Test Automation
Perils of Page-Object Pattern
Patterns of a “good” test automation framework
Patterns of Test Automation
Automated UI Testing Done Right (QMSDNUG)
PageObject
Sustainable Automation Frameworks by Kelsey Shannahan
Automated UI testing done right (DDDSydney)
Design Patterns for QA Automation
Agile Test Automation Anti-patterns and Rescue Strategies
Selenium Deep Dive
Automation Abstractions: Page Objects and Beyond
Clean Code
Page Objects - You're Doing it Wrong by Titus Fortner
Testing smells
Coding Standards
Selenium Design Patterns
Ad

More from Dawn Code (16)

PPT
Executable Specifications with FitNesse and Selenium
PPT
Executable Specifications with FitNesse and Selenium
PPTX
A Sampling of Tools
PPTX
Testing in the Wild
PPTX
Fitting Organizational Structure
PDF
Pair development
PPTX
Remote Dev/Test Pairing
PPTX
Crowdsource Your Career
PPTX
How Low Can Your Tests Go
PPTX
Exploratory testing part 2
PPTX
Exploratory testing part 1
PPTX
Exploratory testing part 3
PPTX
Agile and Exploratory Testing Jeopardy
PDF
Pair Development from the Trenches
PDF
Testing Legacy Apps Mindmap
PPTX
Testing Legacy Apps
Executable Specifications with FitNesse and Selenium
Executable Specifications with FitNesse and Selenium
A Sampling of Tools
Testing in the Wild
Fitting Organizational Structure
Pair development
Remote Dev/Test Pairing
Crowdsource Your Career
How Low Can Your Tests Go
Exploratory testing part 2
Exploratory testing part 1
Exploratory testing part 3
Agile and Exploratory Testing Jeopardy
Pair Development from the Trenches
Testing Legacy Apps Mindmap
Testing Legacy Apps

Recently uploaded (20)

PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
history of c programming in notes for students .pptx
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PPTX
Transform Your Business with a Software ERP System
PDF
Digital Systems & Binary Numbers (comprehensive )
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PDF
iTop VPN Free 5.6.0.5262 Crack latest version 2025
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PDF
System and Network Administration Chapter 2
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PPTX
Operating system designcfffgfgggggggvggggggggg
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
history of c programming in notes for students .pptx
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
Transform Your Business with a Software ERP System
Digital Systems & Binary Numbers (comprehensive )
Internet Downloader Manager (IDM) Crack 6.42 Build 41
iTop VPN Free 5.6.0.5262 Crack latest version 2025
Understanding Forklifts - TECH EHS Solution
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PTS Company Brochure 2025 (1).pdf.......
Why TechBuilder is the Future of Pickup and Delivery App Development (1).pdf
Design an Analysis of Algorithms I-SECS-1021-03
Navsoft: AI-Powered Business Solutions & Custom Software Development
System and Network Administration Chapter 2
Wondershare Filmora 15 Crack With Activation Key [2025
Operating system designcfffgfgggggggvggggggggg
Odoo Companies in India – Driving Business Transformation.pdf
CHAPTER 2 - PM Management and IT Context
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus

Page objects: the good, the bad, the ugly

  • 1. PAGE OBJECTS THE GOOD, THE BAD, AND THE UGLY
  • 2. WHO AM I? • DAWN CODE, INDESCRIBABLE! • COMP SCI DEGREE FROM CLEMSON, 2001 • TESTER -> PROGRAMMER -> TESTER • LIFELONG LEARNER • MACHINE LEARNER • CURRENTLY QUALITY ENGINEERING MANAGER AT IBM WATSON HEALTH CLINICAL DEVELOPMENT
  • 3. IS TEST AUTOMATION CODE REAL CODE? SHOULD AUTOMATION CODE BE WRITTEN FOLLOWING THE SAME CONVENTIONS AS PRODUCTION DEVELOPERS WRITING PRODUCTION CODE?
  • 5. DOES THAT MEAN WE SHOULD IGNORE ALL CLEAN CODING PRACTICES? OF COURSE NOT
  • 6. THE HAPPY MEDIUM • NO NEED TO GET INTO DEEP, TECHNICAL, PROGRAMMING CONCEPTS • ALSO WE DO NOT WANT TO END UP WITH A PROJECT THAT COSTS MORE TO MAINTAIN THAN IT IS WORTH TO EXECUTE • TESTERS CAN START WITH SOME SMALL PRACTICES THAT WORK TOWARD CLEAN, MAINTAINABLE, CODE
  • 7. MAKE CODE HUMAN READABLE • CODE IS READ BY HUMANS, NOT COMPUTERS • CODE SHOULD CONVEY INTENT • NAMES SHOULD BE MEANINGFUL • NAMES SHOULD NOT BE ABBREVIATED
  • 9. HOW COULD WE MODIFY THIS?
  • 11. DRY: DON’T REPEAT YOURSELF • IF YOU FIND THAT YOU DO IT MORE THAN ONCE, PULL IT OUT INTO A SEPARATE METHOD • IF YOU FIND THAT YOU ARE COPYING AND PASTING CODE, CONSIDER HOW MUCH YOU ARE REPEATING YOURSELF
  • 12. WHAT HAPPENS THE NEXT TIME WE WANT TO OPEN THAT EXCEL SPREADSHEET?
  • 14. WHAT ABOUT WHEN ANOTHER USER NEEDS TO PUT THEIR OWN PATH IN?
  • 16. WHAT ABOUT WHEN WE NEED TO INSERT A SHEET AS SHEET 1 IN THESE EXCEL FILES?
  • 19. CLEAN CODE FOR TESTERS • NAME ALL VALUES WITH MEANINGFUL, RELEVANT, HUMAN-READABLE NAMES • DON’T REPEAT YOURSELF
  • 20. GET STARTED WITH SELENIUM • HTTP://WWW.SELENIUMHQ.ORG/DOCS/03_WEBDRIVER.JSP
  • 22. IN THIS MODEL … https://udayhere.files.wordpress.com/2012/06/testautomation1.jpg
  • 23. WHAT DO WE INTEND TO MODEL?
  • 26. WHY USE PAGE OBJECTS? • CLEAN SEPARATION BETWEEN TEST CODE AND PAGE SPECIFIC CODE • REDUCE/REMOVE DUPLICATION FOR OBJECT LOCATION AND INTERACTION • TEST STEPS HAVE MORE MEANINGFUL NAMES ABOUT WHAT THE TEST IS ACTUALLY DOING
  • 27. PAGE OBJECT PATTERNS • GROWING PAGE OBJECTS ORGANICALLY • SELF-VERIFICATION • BUILT-IN NAVIGATION • NO ASSERTIONS IN THE PAGE OBJECT • PRIVATE ELEMENTS IN PAGE OBJECT
  • 28. WHAT GOES WRONG? • MOST OF IT IS ABOUT SCALING • FIRST: WHAT IS A “PAGE”, ANYWAY? • LARGE AND COMPLEX PAGE OBJECTS • NAVIGATION? • IT DOES REQUIRE HIGHER LEVEL OF PROGRAMMING KNOWLEDGE • PAGE OBJECT REPO IS HIGHLY APPLICATION SPECIFIC
  • 29. WHAT ARE YOUR EXPERIENCES?
  • 30. FOR FURTHER READING • WRITING MAINTAINABLE AUTOMATED TESTS, BY DALE EMERY • HTTPS://MARTINFOWLER.COM/BLIKI/PAGEOBJECT.HTML • HTTPS://GITHUB.COM/SELENIUMHQ/SELENIUM/WIKI/PAGEOBJECTS • HTTP://WWW.SELENIUMHQ.ORG/DOCS/06_TEST_DESIGN_CONSIDERATIONS.JSP