You have the right idea, wanting to wait until the bar is done, but you are 
approaching it slightly wrong. I would first try to understand why *you* know 
the progress bar is done. Is it because the bar gets to the end and its full? 
Is it because something says 'complete'? How do you know it failed?

Once you gathered these answers you will probably find you are waiting for a 
certain event to occur. This event doesn't always happen X seconds after you 
click something, it happens when its done (it also will probably fail at some 
point).

So to start, we need to find that 'anchor' in the future. This is some page 
element that lets the user know that its done. Lets pretend this is an image. 
So we want to wait at most, lets say, 20 seconds (this depends on your app) or 
until some image exists.

I'm going to give you some code I'm just thinking up, this should be used to 
help illustrate my idea and maybe inspire a solution from you. I'm sure you 
will think up something much better on your own.

# Note the below code should not be used, its just an idea of how you might do 
this

wait_max = 20
wait_increment = .1
wait = 0

while wait < wait_max
.if ie.image(*whatever*).exists? #this is the event, it could be anything
..# Found it, do the next part
.else
..wait += wait_increment
end
---------------------------------------------------------------------
Posted via Jive Forums
http://forums.openqa.org/thread.jspa?threadID=5861&messageID=16400#16400
_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to