How to wait until page contains 1 of the two predefined elements in Selenium Robot Framework?

Viewed 339

Is there a way to wait until Web page contains 1 of the two elements in Selenium Library.

I tried the following code but clearly it does not work:

Wait Until Page Contains    user is registered    Or    user already existed

Any help is really appreciated.

2 Answers

Until you find a more precise answer maybe you could try with something similar to the following:

${textPresence}    Run Keyword And Return Status    SeleniumLibrary.Wait Until Page Contains     hello world
Run Keyword If    '${textPresence}' == 'False'    SeleniumLibrary.Wait Until Page Contains   hello people

And pay attention to the keywords' timeout.

Did you try to use the Wait For Condition keyword?

Please note that you must give it a javascript expression (in your case it suppose to be document.body.innerText).

Related