The source code reads: <div class="qa">on</div>
And I want to assert in Selenium IDE that the value in between <div ...>
and </div>
is "on
".
I tried to use assertValue and assertAttribute, but got an error with both commands. If I use assertElementPresent for the xpath=//div[@class='qa']
/, it would pass, but it wouldn't assert that the value in between the <div>
's is "on
".
Use assertText
(or verifyText
if the test should not halt on failure):
assertText xpath=//div[@class='qa'] exact:on
From the reference:
assertText(locator, pattern)
Generated from getText(locator)
Arguments:
- locator - an element locator
Returns:
- the text of the element
Gets the text of an element. This works for any element that contains text. This command uses either the textContent (Mozilla-like browsers) or the innerText (IE-like browsers) of the element, which is the rendered text shown to the user.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With