1 / 22

The Power of Page Object Pattern in Test Automation

Discover how implementing the Page Object Pattern can significantly enhance the reliability and maintainability of your test automation framework. Learn about the benefits, actionable tips, and the importance of DRY principles in creating robust automated tests.

urrutxua
Download Presentation

The Power of Page Object Pattern in Test Automation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. A Single Pattern to Drastically Improve Your Test Automation Nikolay Advolodkin QA Automation Engineer www.ultimateQA.com @Nikolay_A00 www.ultimateqa.com 1 1

  2. What is one problem that most of us face with functional test automation? www.ultimateqa.com

  3. Poll: How many tests can you run per day that will give the correct result with 95% accuracy? 2 5000+ 1001 -5000 3 501 -1000 2 101 -500 4 51 -100 5 0 -50 20 www.ultimateqa.com 3 3

  4. Poll: What is a problem that you have with test automation? Flaky tests (6) Framework (6) Lack of knowledge (6) Other, one off issues Synchronization (4) www.ultimateqa.com 4 4

  5. Why is functional test automation so flaky? www.ultimateqa.com

  6. User Experience SVG Canvas Drag & Drop Touch Events AJAX Angular JS http://www.evolutionoftheweb.com/ www.ultimateqa.com 6

  7. How can Automation Engineers handle such an evolving world? www.ultimateqa.com

  8. “The only thing constant in software development is change.” www.ultimateqa.com

  9. Tools Used Version 40.0 Firefox 3.1.2 Selenium Builder 2015 Visual Studio 2.53.1 Selenium Webdriver NUnit 3.4.1.0 www.ultimateqa.com 9 9

  10. Record and Replay: How many tests need to be updated due to a change in AUT? Change Agents How many tests need to be changed? All Driver Initialization All Url All Locators All User names/passwords All Synchronization issues www.ultimateqa.com 10 10

  11. Reusable Portfolio Four Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Methods Resilient Portfolio Five Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Advantages of using Keyword Driven Approach www.ultimateqa.com 11

  12. Method for every action Portfolio Four Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Too much in 1 file Flow changes break all tests Portfolio Five Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Disadvantages of using Keyword Driven Approach www.ultimateqa.com 12

  13. So what can I do then???? So unstable!! Give me the answer already Arghhhh It’s Brittle bro! www.ultimateqa.com 13 13

  14. Page Object Pattern www.ultimateqa.com

  15. Page Object Pattern Object – Page.cs www.ultimateqa.com 15

  16. Page Object Pattern Use your code to interact with the application page just like you would interact with it manually Page.GoToVideoTutorials() Page.ClickStartHereButton() www.ultimateqa.com 16

  17. Maintainable Readable Tests Abstraction Logical Follows Good Design Principles Advantages of Page Object Pattern www.ultimateqa.com 17

  18. DRY – Don’t Repeat Yourself www.ultimateqa.com 18

  19. “Duplication is the primary enemy of a well-designed system” Martin, Robert www.ultimateqa.com

  20. Many different options Portfolio Four Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Increased barrier to entry Requires constant improvement Portfolio Five Lemon drops oat cake oat cake sugar plum sweet gingerbread chocolate cake gingerbread. Disadvantages of using Page Objects www.ultimateqa.com 20

  21. 3 Actionable Tips Start Using Page Objects Use Test Driven Development Stop being WET www.ultimateqa.com 21 21

  22. Resources Code and Slide Deck - http://wp.me/P7absY-8j • Martin, Robert C.. Clean Code: A Handbook of Agile Software Craftsmanship • (Kindle Locations 4076-4077). Pearson Education. Kindle Edition. • Selenium Wiki on Page Objects • Martin Fowler on Page Objects • Dave Haeffner on Page Objects www.ultimateqa.com 22 22

More Related