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.
Good practices for the PageObjects design
Think of a web page as a services provider
At a high level, when you look at a page in a web application, you will find it is an aggregation of various User Services. For example, if you take a look at the All Posts page in our WordPress Admin console, there are many sections in it:
In the preceding screenshot, in the All Posts page, a user can perform the following five activities:
- Add a new post.
- Edit a selected post.
- Delete a selected post.
- Filter the posts by category.
- Search for text in all the posts...