Thanks very much for the reply. I still have a qn on the implementation. Apologize if it is not a valid qn..
But which page object method should I be calling from test method?
Eg: Assuming if the passphrase is not expired and if I call "loginWithValidCredentials" expecting it to return it will return "PassPhrasePage ". But I will be getting "ExpiredPassPhrasePage".
So I should be doing an assertion in the test method after calling each method from a page object to make sure it is on the right page? and if it is not on the right page I should call the next method?
Thanks!
Karthik
On Mon, Mar 25, 2013 at 10:30 PM, tarunkumar [via Manual and Automated Testing]
<[hidden email]> wrote:
Write 3 methods for three different conditions and each of the method would return corresponding page object -
public LoginPage invalidLogin() {
// Invalid login steps
return this;
}
public ExpiredPassPhrasePage loginWithExpiredPassPhrase() {
// Login steps with expired passphrase
return new ExpiredPassPhrase(driver);
}
public PassPhrasePage loginWithValidCredentials {
// Valid login steps
return new PassPhrasePage(driver);
}
Hope this helps