O'Reilly logo

Mastering Selenium WebDriver by Mark Collin

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 5. Working with Effective Page Objects

In this chapter, we will:

  • Study DRY (Don't Repeat Yourself) and have a look at how we can apply it to page objects.
  • Examine why we should keep our assertions separate from page objects.
  • Have a look at the Java PageFactory classes that are available in the Selenium Support package.
  • Look at how we can build sensible extensible page objects that do the hard work of driving our tests.
  • Talk about how we can make a readable DSL (domain-specific language) using page objects. We don't need Cucumber to write readable tests.

We are going to work through some examples in this chapter. So, you will need your development IDE set up and ready to start writing some code. You can use the base Selenium implementation that ...

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