Good practices for the PageObjects design

So, now that you have seen what a simple implementation of PageObject looks like, it's time to consider some good practices in designing PageObjects for your test framework.

Consider a web page as a services provider

At a high level, when you look at a page in a web application, it is nothing but an aggregation of various User Services in one place. For example, if you take a look at the All Posts page in our WordPress Admin console, there are many sections in it, as shown in the following screenshot:

Consider a web page as a services provider

In the preceding All Posts page, a user can perform the following five different activities:

  • Add a New post. ...

Get Selenium WebDriver Practical Guide now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.