# How to wait for an element containing certain string?

**URL:** <https://forum.robotframework.org/t/how-to-wait-for-an-element-containing-certain-string/7088>\
**Category:** SeleniumLibrary\
**Created:** [28 March 2024 10:19 UTC](https://forum.robotframework.org/t/how-to-wait-for-an-element-containing-certain-string/7088 "2024-03-28T10:19:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [28 March 2024 10:19 UTC](https://forum.robotframework.org/t/how-to-wait-for-an-element-containing-certain-string/7088/1 "2024-03-28T10:19:17Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![damies13](https://dub1.discourse-cdn.com/flex005/user_avatar/forum.robotframework.org/damies13/32/623_2.png) [@damies13](https://forum.robotframework.org/u/damies13)\
**Post date:** [28 March 2024 12:08 UTC](https://forum.robotframework.org/t/how-to-wait-for-an-element-containing-certain-string/7088/2 "2024-03-28T12:08:07Z")

</div>

Hi Pavel,

Actually you can use [Wait Until Page Contains Element](https://robotframework.org/SeleniumLibrary/SeleniumLibrary.html#Wait%20Until%20Page%20Contains%20Element) or most of the with any of the `Wait Until` keywords, the trick is to use an xpath with a contains, e.g.:

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

```

Dave.

---

<div class="post-metadata">

**Author:** ![PavelK](https://avatars.discourse-cdn.com/v4/letter/p/bbe5ce/32.png) [@PavelK](https://forum.robotframework.org/u/PavelK)\
**Post date:** [28 March 2024 12:18 UTC](https://forum.robotframework.org/t/how-to-wait-for-an-element-containing-certain-string/7088/3 "2024-03-28T12:18:25Z")

</div>

Hi Dave,

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