How to wait until a Screen contains a special text

Hi all,

Do we have any function to stop webdriver and wait until the screen contains a certain text.

Same function of RobotFramework : Wait until page contains.

Im testing a mail box. When i go to Inbox and select a mail to open. Then I need to wait until the screen contains the text “Sent by xxApp” to continue other actions.

In the real world, when i open a mail , it will need some time to load the body of mail fully.

Any one have suggestion for this issue.

Investigate

WebDriverWait
FluentWait

I always use waits when looking for my content.

Hi,

Thanks for your advice, it works now with below code :

WebDriverWait wait=new WebDriverWait(driver, 120);
wait.until(ExpectedConditions.textToBePresentInElement(webElement, “textToFind”));