I don't know who added this. It was either Paul Rogers or someone else. It wasn't me. So i can't tell you what the intent was. Someone could search through the commit history to find out when it was added and by whom.

Bret

On 3/15/06, Paul Carvalho <[EMAIL PROTECTED]> wrote:
Hello there, I've been playing with the "image" functions lately and I noticed something that seems odd to me that I'd like to check.  I am using Watir 1.4.1.

In one of my scripts that checks the web page size and load times, I didn't factor in the size of the graphics because in most cases they were negligble.  However on some reports, the whole page is mostly made up of a large chart image.  In that case I wanted to include the image file size as part of the "page size".  Here's the line of code I use:

   page_size = $ie.frame('MainWindow').html.length + $ie.frame('MainWindow').image(:index, 2).fileSize.to_i

The question I have is why "length" returns a number but "fileSize" returns a string (of a number)?  It took me a minute to figure out that fileSize was returning a string and that's why the sum was failing.  Once I appended the ".to_i" it worked fine.

Is this by design?  It just seems a bit inconsistent to me.  Since I don't know the history of this function I thought I'd ask.  I haven't explored any other functions that return numbers to see if they are also strings.

Paul.



_______________________________________________
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