If you knew of some text that was always present in the html of a
loaded page, but not present when one of the error pages is displayed
you could use:

    ie.html.match(/some_text_that_is_always_present/)

I imagine there is a better way to do it though.

Cheers,
Daniel.





On 07/06/06, Rodrigo Julian Martin <[EMAIL PROTECTED]> wrote:
>
>
>
>
> 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.
> _______________________________________________
> Wtr-general mailing list
> [email protected]
> http://rubyforge.org/mailman/listinfo/wtr-general
>
>
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to