Where should be used assertion whether in Test Script or can be used some in page object class too?

13 показвания
Преминаване към първото непрочетено съобщение

Anupam Tiwari

непрочетено,
8.09.2016 г., 10:42:518.09.16 г.
до webdriver
I have a scenario to test Login page:
1. If enter invalid username and password combination appears an validation message 'Invalid Username/password combination"
2. If enter unregistered username and password combinations appears an validation message 'Username is not registered!"
3. If valid username password next Home page is appeared. 

My question is for test cases 1st and 2nd: 
I want to verify validation message appears on the page. First locate the message element and then use AssertEqual  to compare actual and expected. 
Where should I verify it whether on page object class or in Test Script?

If In test Script, where WebDriver object is not being created then how to handle locators for the message element? 

Bill Ross

непрочетено,
8.09.2016 г., 12:58:198.09.16 г.
до webd...@googlegroups.com

> If In test Script, where WebDriver object is not being created then how to handle locators for the message element? 

You would wrap the access methods, including locators, in your page object, and in your test script call a method like

  myPage.verifyResponse("Username is too unusual!");

Bill
--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To unsubscribe from this group and stop receiving emails from it, send an email to webdriver+...@googlegroups.com.
To post to this group, send email to webd...@googlegroups.com.
Visit this group at https://groups.google.com/group/webdriver.
For more options, visit https://groups.google.com/d/optout.

Отговор до всички
Отговор до автора
Препращане
0 нови съобщения