Always look for implied services

Some of a page's services can be identified very clearly on it. And there are some services that are not visible on the page but that are implied. For example, in the All Posts page, we have identified five services just by looking at the page. But let's say your test case wants to know the count of existing posts; this information is available on the All Posts page, and we have to make sure that your PageObject provides that as an implied service. Now you extend your PageObject for the All Posts page with this implied service, which looks as follows:

public class AllPostsPage {    WebDriver driver;        @FindBy(id = "the-list")    WebElement postsContainer;    @FindBy(id = "post-search-input")    WebElement searchPosts

Get Selenium WebDriver 3 Practical Guide - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.