Hi,

I am testing a webpage where my aim is to wait for the page to load
all the images and once the page loaded all images i will record the
page load time.

using wait_until and sleep, still images are not loading within the
time period and i don't want to hard code the time limit to load.

Is there anyway to introduce loop to check whether the page has loaded
all the images or not? Also all images should be visible on UI.

My script:-
----------
> require 'watir'
> require 'watir/contrib/visible.rb'
> include Watir
>
> $ie = Watir::IE.new
>
> test_site = 'http://test.net'
> $ie.goto(test_site)
> $ie.maximize
> $log.info( 'Time taken to load Home page' )
> $log.info($ie.down_load_time.to_s)
>
>
> #Perform Login Action
> $log.info("Login to testsite")
> $ie.text_field(:name, "userName").set("user")
> $ie.text_field(:name, "password").set('u1')
>
> $ie.button(:value, "Login").click
> $log.info( 'Time taken to load Home page' )
> $log.info($ie.down_load_time.to_s)
>
> #Click on Products tab
>
> $log.info("Click on products tab")
> $ie.image(:name, 'toplogo_nav_04_off').click
> $ie.images.each{|image|Watir::Waiter.wait_until(10){image.exist?}} # in this 
> step I need to wait until all the images is loaded properly and visible.How 
> can I add loop here to check all the images are loaded or not?>
>
> $log.info( 'Time taken to load Products page' )
> $log.info($ie.down_load_time.to_s)
> $log.info($ie.images.length)
>
>
> ----

Thanks
Maumita
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to