Selenium: test if element contains some text Selenium: test if element contains some text selenium selenium

Selenium: test if element contains some text


The Selenium-IDE documentation is helpful in this situation.

The command you are looking for is assertText, the locator would be id=fred and the text for example *bcd*.


It can be done with a simple wildcard:

verifyTextid="fred"*bcd*

See selenium IDE Doc


You can also use:

assertElementPresentcss=p#fred:contains('bcd')