Michael Bautista
Michael Bautista

Reputation: 1220

Selenium IDE - Verifying hidden/visible verification messages?

There's a webpage I'm trying to test that has multiple textboxes. Each textbox has its own specific validation message that is hidden.

Before an incorrect value is entered, I am use 'verifyNotVisible' in order to confirm that there is no validation message being shown to the user. This part passes just fine.

Afterwards, I have selenium type in invalid characters to make the validation message show.

The problem I'm having at this point is that while the validation message is visible to me, Selenium is still failing at the 'verifyVisible' line right after entering the invalid characters.

The following is what I have in Selenium:

Selenium IDE Info Full Image: https://i.sstatic.net/W5RrH.png

Note that the validation messages are set to hidden prior to having invalid characters entered. Additionally, both 'assertValue' and 'verifyTextPresent' are passing before and after the validation message is being shown.

Does anyone know of a way to have Selenium pass the 'verifyVisible' portion correctly?

Upvotes: 1

Views: 4706

Answers (1)

borrible
borrible

Reputation: 17366

You may need to insert an appropriate wait period. If you are checking verifyVisible immediately after inserting your invalid character the modified DOM might not yet be there at the point your comparison is being made.

Take a look, for example, at Selenium's clickAndWait to see how to wrap an appropriate pause.

Upvotes: 1

Related Questions