Common methods
At this point, the abstract base class has been built with the page factory initialization, abstract methods, and common elements, and, finally, we need to add some common methods. What methods should go in the base class?
Basically, any method that would apply to each of the subclass page objects goes into this class. Examples would be: navigation bar methods; page methods to retrieve titles, copyrights, logos, and headings; methods for logging out of the application; methods to synchronize against spinner controls that appear on each page; methods that handle alert and error message windows; custom methods for drop-down list selections; methods for label and text verification; and so on.
Any method that can be made "generic" ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access