[Wtr-general] [question] Setting timeout for a ie.wait method?
Chris McMahon
christopher.mcmahon at gmail.com
Thu Jun 1 13:51:53 EDT 2006
> I'm doing this because I need to test if a page has been loaded correctly
> after clicking a link, maybe there's a easier form of checking this..
>
def wait_for_page(seconds)
begin
@ie.link(:text,"My Incredibly Important Link").click
do_the_next_thing_method
rescue
sleep 1
seconds = seconds + 1
if seconds == 10
puts "waited over 10 seconds for Incredibly Important Link,
tried 10 times, exiting"
exit
end
wait_for_page(seconds) #CALL THE SAME METHOD AGAIN
end
I haven't tested it but it should be OK.
-Chris
More information about the Wtr-general
mailing list