Progress Bar Interaction

So...

I'm trying to have Eggplant perform an action during a certain point of an operation taking place on the computer. Basically, at say, 50% to completion, I'd like Eggplant to cancel the operation.

No problem, I figure.

I try

if imageFound (5, "Progress_25")
		click "CancelButton"
	else
		exit all
	end if

Unfortunately, the progress bar goes by so quickly (0 to 100 in probably 2 or 3 seconds) that it seems Eggplant can't catch it in time. I tried putting the SUT in greyscale, in hopes that a simpler image would be quicker to find, but that has had no effect.

Any ideas?

Comments

  • So, another option...

    While this is going on, progress is being written to a log. I suppose I could also somehow have Eggplant "read" that log, and when it sees the appropriate percentage, do it's thing, but I'd *really* have no idea how to do that, or if it's even possible.

    This is all done on a Mac, by the way.
  • EggplantMattEggplantMatt ForumAdmin admin
    edited January 2009
    Sounds like you should just start the operation, do a Wait 1.0 (or 2) and then click Cancel. You could also look for just a portion of the left end of the progress bar to make sure that it has started filling in before clicking cancel. The last thing you could try would be to set the SearchRectangle to be tightly focused on the progress bar. This option would be tricky though; you'd probably have to rely on hard coded coordinates and you'd still have to hit the timing just right to make the match.
  • SenseTalkDougSenseTalkDoug ForumAdmin admin
    Actually, I think setting the SearchRectangle may be a good idea. If you set the SearchRectangle to an area that covers most of the center part of the progress bar, and search for an image that includes just the end of the bar as it progresses, then you should be able to catch it after it begins and before it gets too far along (unless it goes very fast).

    If the progress bar is moving fairly fast you may have to set some timing parameters (reduce the searchDelay, for example, as described in other topics here on the forum) in order to be sure to catch it. Then just use a WaitFor command to wait for it to appear within the SearchRectangle.

    Good luck! And be sure to post back here to let people know what works for you.
Sign In or Register to comment.