[Wtr-general] HTML Page Size and Load times

Paul Carvalho tester.paul at gmail.com
Mon Feb 27 16:23:53 EST 2006


Hi there, I'm currently writing a script that will walk through our site map
and spit out a list of page sizes and load times to a text file.

Using the Watir examples I found a function that gets the html page and I
guessed that you could get the length using:
> puts ie.html.length

This spits out a number that is not quite what I expected - it's a bit low.
So, I output what the function gets (e.g. using "puts ie.html") and I copied
it to a text file.  I then went to the web browser and used View > Page
Source and saved the output to a different file.  Comparing the page outputs
I got the following numbers:
> ie.html.length  = 12653
> File size of original Page source = 14260 bytes

Visually comparing these files, I found that when you use View > Page Source
from the browser, you get the whole Page HTML, but when you use the Watir "
ie.html" method, you get a stripped down version of the page html.  For
example, the Header info is absent as well as any pretty indenting.

That might be good for when I need to parse the file and get specific info
out of it, but not when I need to know the exact page size.  Is there a way
that I can use Watir or Ruby to collect the *whole* page html?

Incidentally, someone once mentioned to me that there is a down_load_time
attribute, but I can't find any info on it anywhere.  Is there a reference
in the Watir API or elsewhere that can tell me what methods and attributes
are available for working with the HTML pages?

Thanks.  Paul.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://rubyforge.org/pipermail/wtr-general/attachments/20060227/0cbd2408/attachment.html 


More information about the Wtr-general mailing list