How to wait for an element containing certain string?

Hi folks,

As the subject describes, I’m looking for a way to wait for an element, containing certain string. I know there is a keyword Wait Until Element Contains. But this works only if the string is located in Text attribute and it does not work if the sting is somewhere else, e.g. in Value attribute. So I’m curious, if there is another way to wait for an element, containing string, regardless of where it’s written. Ideally, it should be a method, which searches for the strings also in all child elements of given locator. Thanks.

Hi Pavel,

Actually you can use Wait Until Page Contains Element or most of the with any of the Wait Until keywords, the trick is to use an xpath with a contains, e.g.:

Wait Until Page Contains Element    //*[contains(@value, "searchstring")]

Dave.

3 Likes

Hi Dave,

Cool! This will do the trick. Thank you for the help!

1 Like