Waiting for page load using Watir

1,563 views
Skip to first unread message

ranjith kumar

unread,
May 6, 2011, 12:47:10 AM5/6/11
to watir-...@googlegroups.com
Hello Team,
 
I want my script to wait till a page loads completely or till i find a link/text/object in the page using watir
 
 
Could you please provide me some sample examples for that.
 
Exa:--
Navigate to www.google.co.in...
I want my sctipt to wait til i could see done status in the status bar of my IE.
The same way for waiting till i find the button "search"
 
Please help.
 
Regards,
Ranjith

Alastair Montgomery

unread,
May 6, 2011, 4:51:14 AM5/6/11
to watir-...@googlegroups.com

You can use something like the following to wait until a page element is displayed.

browser.link(:id,"mylink").wait_until_present

this will wait until the element is on the page but will time out if it doesn't appear within 60 seconds.

joedio

unread,
May 9, 2011, 4:17:06 PM5/9/11
to Watir General
Ranjith,

If you just want to check that the Status bar text is "Done"
then this loop will work, since Watir can read the Status text
in IE of Firefox.

# Loop until the status bar text is "Done"
while(browser.status != "Done") do
sleep(1)
end

Joe

On May 5, 10:47 pm, ranjith kumar <ranjith....@gmail.com> wrote:
>
> I want my sctipt to wait til i could see *done* status in the status bar of
> my IE.
Reply all
Reply to author
Forward
0 new messages