How to use keyword 'Wait For Condition' in Selenium2Library?

3,465 views
Skip to first unread message

Lieping Xie

unread,
Mar 27, 2013, 3:43:42 AM3/27/13
to robotframe...@googlegroups.com
Hi,

In the Selenium2Library there is one keyword 'Wait For Condition' and from the documentation it does not mention how to give the condition? Could someone give some examples?

My use case is
- Go to home page
- Click the button to another page
- As sometimes it takes time to load the next page, I guess it is better to use 'Wait For Condition' to check? (check the location changes, not the elements exist as I saw 'Wait Until Page Contains (Element)' should fit for that)

--
Best regards,
Xie Lieping, Frank

Markus Bernhardt

unread,
Mar 27, 2013, 4:08:18 AM3/27/13
to fra...@gmail.com, robotframe...@googlegroups.com
Hi,

the keyword Wait For Condition executes Javascript inside the browser. The Javascript code has to return a boolean and if that is true, then the condition is fulfilled. Example:

    Wait For Condition    return window.document.title == "Changed"

Hope that helps.

Cheers,
Markus



--
You received this message because you are subscribed to the Google Groups "robotframework-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to robotframework-d...@googlegroups.com.
To post to this group, send email to robotframe...@googlegroups.com.
Visit this group at http://groups.google.com/group/robotframework-devel?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Kumar Prem WSA

unread,
Dec 7, 2013, 9:46:27 AM12/7/13
to robotframe...@googlegroups.com
use <sleep n seconds>
Reply all
Reply to author
Forward
0 new messages