hrm...how about putting the sleep statement in a loop and checking if
the image exists?  like:

while !ie.frame(....).image(....).exists?
    sleep(1)
end

ie.frame(...).image(...).click


Shao


On 7/15/05, Tuyet Cong-Ton-Nu <[EMAIL PROTECTED]> wrote:
> 
> 
> I have to pepper some sleep statements in my script because the application
> I am automating takes a variable amount of time to load a page.
> 
> I tried inserting some wait statements for a frame but can't seem to do it
> for an object like an image.  I have to resort to sleep statements but some
> time it takes longer and the script fails.  I can, of course, add a longer
> sleep time, but I am trying to find a better way to handle this.
> 
>  
> 
> 1)This is what I am doing now:
> 
> ie.frame("portfolioTreeContent").wait("treeframe")   
> 
> sleep 2
> 
> ie.frame(:name, "portfolioTreeContent").frame(:name,
> treeframe).image(:src, /img-plus-cont-0.gif/).click
> 
>  
> 
> 2)This is what I wish I can do (wait until the image has been loaded, then
> click on it)
> 
> ie.frame("portfolioTreeContent").frame("treeframe").wait(/img-plus-cont-0.gif/)
> 
> ie.frame(:name, "portfolioTreeContent").frame(:name,
> treeframe).image(:src, /img-plus-cont-0.gif/).click
> 
>  
> 
>  
> 
>             
> 
>  
> _______________________________________________
> 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