"VerifyTextPresent" returning incorrect result for Selenium IDE

Aditya picture Aditya · Nov 10, 2009 · Viewed 12.4k times · Source

I am using Selenium IDE to record some scenarios and wanted to check if a particular text is present on the page. I inserted a command "VerifyTextPresent". However, it always returns the result as true even when the particular text is not present.

What can be the probable reason? Do I need to modify anything?

Answer

ulkash picture ulkash · Nov 10, 2009

Looking at the sourcecode it looks like you are putting the text you are searching for in the incorrect field. verifyTextPresent (and assert...) has only two parameters unlike verifyText which also requires a target.

Unlike verifyText the text element you are searching for should be entered into the second field 'Target' not in 'Value'.

thus the code becomes

<tr>
<td>verifyTextPresent</td>
<td>XYZ</td>
<td></td></tr>

I made the same mistake when learning Selenium as the field names are misleading!