[Wtr-general] how to tell when IE is *really* done

Danny R. Faught faught at tejasconsulting.com
Mon Nov 27 17:49:13 EST 2006


I'm having trouble getting a script to tell me accurately when a page
has finished rendering. I'm running Watir 1.4.1 with Ruby 1.8.5 on
Windows XP Pro SP2.

I'm clicking a link that opens a new browser window, then I attach to
the window. The attach returns before the contents of the window are
rendered. There is a lot of javascript processing going on to do the
rendering - I'm guessing that IE is saying it's done when the code and
data are all downloaded, even though Javascript is still executing.
Adding extra calls to the wait method doesn't help - IE insists that
it's no longer busy, according to ie.busy. The rendering can take 30
seconds or more.

Can anyone suggest a way to determine when the page has been completely
rendered? Or when Javascript code is not currently executing?

The best idea I've had so far, which isn't a very good idea, is to use
a heuristic to watch for some element of the page to appear in the
document. In my case, this would require traversing a quagmire of nested
frames to find the content.

-Danny


More information about the Wtr-general mailing list