Think of methods in PageObjects as services and not as user actions

There might sometimes be confusion surrounding what methods make a PageObject. We saw earlier that each PageObject should contain User Services as their methods. But quite often, we see some implementations of PageObjects in several test frameworks that constitute User Actions as their methods. So what is the difference between a User Service and a User Action? As we have already seen, some of the examples of User Services on the WordPress Admin console are as follows:

  • Create a new post
  • Delete a post
  • Edit a post
  • Search in posts
  • Filter posts
  • Count all existing posts

All the preceding services talk about the various functionalities of the target application. Now, let's see ...

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.