Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Perils of Page-Object Pattern

7,466 views

Published on

Page-Object pattern is very commonly used when implementing Automation frameworks. However, as the scale of the framework grows, there is a limitation on how much reusability really happens. It inherently becomes very difficult to separate the test intent from the business domain.

I talk about this problem, and the solution I have been using - Business Layer - Page-Object pattern, which has helped me keep my code DRY.

For more details (links to slides, etc.), see my blog: http://goo.gl/biRn4n

Published in: Software
  • My brother found Custom Writing Service HelpWriting.net and ordered a couple of works. Their customer service is outstanding, never left a query unanswered.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Dating for everyone is here: ♥♥♥ http://bit.ly/2F90ZZC ♥♥♥
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Sex in your area is here: ❤❤❤ http://bit.ly/2F90ZZC ❤❤❤
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD THIS BOOKS INTO AVAILABLE FORMAT (2019 Update) ......................................................................................................................... ......................................................................................................................... Download Full PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download Full EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download Full doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download PDF EBOOK here { https://soo.gd/irt2 } ......................................................................................................................... Download EPUB Ebook here { https://soo.gd/irt2 } ......................................................................................................................... Download doc Ebook here { https://soo.gd/irt2 } ......................................................................................................................... ......................................................................................................................... ................................................................................................................................... eBook is an electronic version of a traditional print book THIS can be read by using a personal computer or by using an eBook reader. (An eBook reader can be a software application for use on a computer such as Microsoft's free Reader application, or a book-sized computer THIS is used solely as a reading device such as Nuvomedia's Rocket eBook.) Users can purchase an eBook on diskette or CD, but the most popular method of getting an eBook is to purchase a downloadable file of the eBook (or other reading material) from a Web site (such as Barnes and Noble) to be read from the user's computer or reading device. Generally, an eBook can be downloaded in five minutes or less ......................................................................................................................... .............. Browse by Genre Available eBooks .............................................................................................................................. Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, ......................................................................................................................... ......................................................................................................................... .....BEST SELLER FOR EBOOK RECOMMEND............................................................. ......................................................................................................................... Blowout: Corrupted Democracy, Rogue State Russia, and the Richest, Most Destructive Industry on Earth,-- The Ride of a Lifetime: Lessons Learned from 15 Years as CEO of the Walt Disney Company,-- Call Sign Chaos: Learning to Lead,-- StrengthsFinder 2.0,-- Stillness Is the Key,-- She Said: Breaking the Sexual Harassment Story THIS Helped Ignite a Movement,-- Atomic Habits: An Easy & Proven Way to Build Good Habits & Break Bad Ones,-- Everything Is Figureoutable,-- What It Takes: Lessons in the Pursuit of Excellence,-- Rich Dad Poor Dad: What the Rich Teach Their Kids About Money THIS the Poor and Middle Class Do Not!,-- The Total Money Makeover: Classic Edition: A Proven Plan for Financial Fitness,-- Shut Up and Listen!: Hard Business Truths THIS Will Help You Succeed, ......................................................................................................................... .........................................................................................................................
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • I also feel Page Objects have too many concerns. Here's an article about another way to decompose the page objects. http://michaelpavlakcoding.blogspot.com/2016/06/decomposing-page-objects.html
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Perils of Page-Object Pattern

  1. 1. PERILS OF PAGE-OBJECT PATTERN Anand Bagmar Test Practice Lead 1
  2. 2. @BagmarAnand about.me/anand.bagmar ABOUT ME
  3. 3. WHAT DO YOU EXPECT FROM THIS SESSION?
  4. 4. What is Test Automation?
  5. 5. Automation – A Safety Net
  6. 6. Case Study
  7. 7. START OF AN AUTOMATION FRAMEWORK
  8. 8. Code sample - #1
  9. 9. WILL THIS WORK? WHAT PROBLEMS EXIST?
  10. 10. Order out of Chaos!
  11. 11. WHAT IS A PATTERN?
  12. 12. WHY PAGE OBJECT? WHAT IS IT? Simulates user actions Model pages in code One place change Reduces code duplication Snippets of page
  13. 13. AUTOMATION FRAMEWORK WITH PAGE OBJECTS
  14. 14. Code sample - #2
  15. 15. If you keep the Automation Framework Principles and Practices in mind …
  16. 16. PRINCIPLES FOR A TEST AUTOMATION FRAMEWORK Design Patterns Code quality Abstraction Layers Refactor, Evolve & Extend Pairing
  17. 17. PRACTICES FOR A TEST AUTOMATION FRAMEWORK No Copy-Paste Configurable Continuous Integration (CI) Test Data Tools & Utilities - Logging - Screenshots - Video
  18. 18. AUTOMATION FRAMEWORK WITH PAGE OBJECTS
  19. 19. Code sample - #3
  20. 20. APPLICABLE FOR
  21. 21. TIPS Especially in Data / Locator heavy pages Ø No getters / setters Ø Logical grouping Ø Handle waits
  22. 22. LIMITATIONS OF PAGE-OBJECT PATTERN Test intent gets polluted Duplication of Test intent & implementation Intent becomes Imperative Maintenance challenges Scaling challenges
  23. 23. IDEAL TEST AUTOMATION PYRAMID Manual / Exploratory UI Web Service View JavaScript Integration Unit Time Value Cost Business-facing Tests Technology-facing Tests
  24. 24. 26 BUSINESS-LAYER PAGE-OBJECT PATTERN
  25. 25. Code sample - #4
  26. 26. ADVANTAGES Validate what is important - Business requirements Test Pyramid remains sane Abstraction layers allow separation-of-concerns Changes are isolated Maintenance & Scaling becomes ‘easier’ Advantages of Business-Layer Page-Object Pattern
  27. 27. TEST AUTOMATION FRAMEWORK BEST PRACTICES Assertions & Validations In Business Layer Model Test Data Identify intent in business terminology Proper abstraction layers Pages as Dummy objects Build Tools & Utilities Evolve Programming practices Design Patterns OOPs
  28. 28. REFERENCES Page Objects – Google https://code.google.com/p/selenium/wiki/PageObjects Page Objects – Martin Fowler http://martinfowler.com/bliki/PageObject.html Test Design Consideration http://docs.seleniumhq.org/docs/06_test_design_considerations.jsp
  29. 29. abagmar@gmail.com Anand.Bagmar@thoughtworks.com @BagmarAnand about.me/anand.bagmar THANK YOU

×