user3558620
user3558620

Reputation: 13

Selenium IDE Conditional Statements

I want to ask if there is another way to check error label that's shown if we didn't fill field that is required to filled besides using verifyText command.

Here's the example :

ID : [is required]

PW : [is required]

Email : [is required]

Dropdown box : [is required]

Is there a simple way to create test case if firstly we just filled ID textbox, and then the three error label will show if there are other field that need no be filled too. Also if we just filled PW or Email error label from ID and dropdown box will shown.

Before for save while that field is empty I'm just using verifytext, but if there conditional requirement too many like this is there any easy and simple way to create this testcase?

Thx

Upvotes: 0

Views: 646

Answers (1)

rwbyrd
rwbyrd

Reputation: 416

If I understand you correctly, you're looking for a way to verify an error message you expect to appear when a user neglects to fill out all the necessary text fields.

I've had some success using the waitForText command. Since you know and expect the error message to appear, this command will wait until it sees the expected error message('s) before moving on. The command fails when it's unable to find the expected text after 30 seconds. This has also been useful when I've had to run my tests on slower machines.

Hope this helps someone out.

Also, as a side note, if you need to adjust the amount of time Selenium IDE waits before failing on a 'wait' statement, do the following:

Go to.. Options > Options... In the Default timeout text box, change the wait time to whatever you desire, in milliseconds.

Upvotes: 1

Related Questions