Page 1 of 1

Wait for ImgTag to load

Posted: Sun Mar 18, 2012 5:43 pm
by johnsmith
Hello,

I have a webpage with an image. The image takes some time to load (around 1-2 seconds).

Is it possible to somehow validate that the image is loaded?

Right now the only safe option for me is to wait with Delay.Duration (5000)

Validate.Exists on the adapter always returns true. It seems to me, the reason is that the webpage itself is loaded before the image.

Thank you!

Re: Wait for ImgTag to load

Posted: Mon Mar 19, 2012 2:34 pm
by Support Team
Hi,
johnsmith wrote:Is it possible to somehow validate that the image is loaded?
Yes it is possible but you have also to improve the html code. If the html tag has an attribute like
onload="this.loaded=true;"
then you can use Ranorex to validate if this attribute is set to true.

Regards,
Peter
Ranorex Team

Re: Wait for ImgTag to load

Posted: Mon Mar 19, 2012 5:52 pm
by johnsmith
What I ended up doing is I captured a screenshot of a blank element and was waiting for it to go away.