Imagine there is a page say http://google.com/AddUser and here you enter details for a record and click save. Once you do this the page redirects to
where you can see list of users including the new record you just entered.
If we are going by page object model, the method to enter details and save record should exist on AddUser.java
and the method to validate if the record was actually saved and displayed should be on UserList.java
If we consider addUser and userList are the corresponding objects for both classes it will be something like below :
addUser.enterDetailsSaveRecord();
userList.validateSavedRecord();
So in my Test case i would need to call 2 separate methods, one for the action and other to validate.
Both AddUser.java
and UserList.java
have BasePage.java
as the superclass.
Is there a way to club them both into a single method or is there something I'm going about in a wrong way and is there a better approach?
Thank you