O'Reilly logo

Selenium WebDriver Practical Guide by Satya Avasarala

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 9. Understanding PageObject Pattern

Until now, we have seen various APIs of WebDriver and learned how to use them to accomplish various actions on the web application we're testing. We created many test scripts that use these APIs and are executed on a daily or weekly basis. One big challenge that you have to deal with, regarding these test scripts, is maintainability. In this chapter, we will cover the following topics:

  • What is the PageObject pattern design?
  • Good practices for designing PageObjects
  • Extensions to the PageObject pattern
  • An end-to-end example

A decently written test script would work just fine as long as the target web application doesn't change. But once one or more pages in your web application change, you as a test script ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required