How can I check if the text I’m looking for exists in this html ?
<ul>
<li class="texto">
Warning, invalid login. The login <b> rafael1983 </ b> is already associated with a registered user.
</li>
</ul>
I’m doing this xpath expression to retrieve the text:
//*[contains(child::text(), 'Warning, invalid login. The login rafael1983 is already associated with a registered user.')]
however the “rafael1983” is within the <b> tag, so that expression does not work, anyone know how to solve this?
Try
or:
depending on exactly which element you want to match.
It seems a bit strange to me that you want to check for that specific string, including the login name – I would expect that you are interested in ANY ‘Invalid login’ message.