Hi,
The app I'm testing has very dynamic pages, constructed by a series of
queries, leading to certain elements loading faster than others. I'd like to
benchmark how long it takes for various pages to load. Toward that end I
wrote:
100.times do
url = $url_root + "/view?id=%239202a8c04000641f8000000000056de6"
start = Time.now
$ie.goto(url)
if $ie.link(:text,'Million Dollar Baby').exists?
$results_array << $ie.down_load_time.to_s
p '$ie.down_load_time: '+$ie.down_load_time.to_s
else # there's a problem with the page
$results_array << 'e'
p 'e'
end #if
took = Time.now - start
p 'Took: ' + took.to_s
end #N.times do
Which yields results like:
ruby performance_benchmark2.rb
Loaded suite performance_benchmark2
Started
"$ie.down_load_time: 1.993"
"Took: 2.434"
"$ie.down_load_time: 2.473"
"Took: 2.583"
"$ie.down_load_time: 2.404"
"Took: 2.564"
I'm curious why I get up to .5 seconds more for 'took' than I do for
down_load_time. Does down_load_time have a way of knowing when everything on
the page has finished loading on a page where various elements render in
phases?
I can include more of my script if that's helpful. Our site freebase.com is
in an invite-only alpha right now, but if anyone wants to dig further into
this I would happily forward along on invite.
Thanks,
Jeff
--
http://testingjeff.wordpress.com
_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general