[Wtr-general] [question] Setting timeout for a ie.wait method?
Rodrigo Julian Martin
rodrigo.martin at enratio.com
Wed Jun 7 08:44:30 EDT 2006
Hello Bret, ie.down_load_time is a Watir 1.5 feature, right?
I'm afraid I still have to use the 1.4.1 release (because of WET
compatibility for example). Is there a way I could manage this with
1.4.1?
My code is like this:
[code]
$browser.links.each do |link|
all_links[i]=link.href
i+=1
end
i=0
puts ("Links: #{all_links.length}")
gets
all_links.each do |test|
if $browser.link(:url,"#{test}").exists? == true
$browser.link(:url,"#{test}").click
$browser.wait
else
puts("Link #{i}: #{test} --- Not Found!")
end
i+=1
end
[/code]
Well, I need a way of check that each link that was clicked have loaded
"completely" a page, else I need to report which link fails.
So, I first think of setting a timeout to the wait, something like "if
after 10 seconds the wait state is still there, let's suppose the page
hasn't loaded".
1) Bret, could I manage this with an assert sentence in 1.4.1?
2) Can I catch html messages like "200 OK" after clicking a link?
3) Can I manage html load errors like 404 File Not Found?
That's it, I would really appreciate any help...
Thanks in Advance!
Rodrigo Julian Martin
________________________________
> If all you want to do is verify how long it took to load a page, you
can do this:
> ie.link(:name, "foo").click
> assert( ie.down_load_time < 10)
> I have actually been thinking of adding a timeout to the wait method,
but i'm not sure your situation really needs it.
> Bret
> P.S. I have my doubts about McMahon's suggestion.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060607/28e11521/attachment.html
More information about the Wtr-general
mailing list