Page 1 of 1

Validating an image and using it in a while loop

Posted: Tue Nov 21, 2017 4:03 pm
by manalitatke
Hello,
While proceeding to next step from my previous step as seen in the ranorex snapshot,

I am trying to go to the next step by selecting next step, however, if i do not introduce a delay/ waitfor attribute to validate the progress bar screenshots, it somehow skips the next button mouse click, and tries to search my next window.

While proceeding from step 1 to step 2, i want to introduce a 'waitforattribute contains image' from step 1 to step 2 by following the below method:

While ( validate.contains image for step 1 == true)
{
Waitforattribute(500 ms , image from step2)
}

Eg:

As attached in the snapshot, the window (step 1) contains a progress bar, that proceeds to completion.
I have taken ranorex screenshots of the progress bar while it just started to buffer and when it was about to complete. The next button is initially disabled and gets enabled only when the progress bar has been completely green.

I am validating all these ranorex screenshots in my step 1 validate image, and putting them in the while condition.

However, the problem is :
If i say i want to validate a screenshot image from step 1

while ((Validate.ContainsImage(progressbarInfo, GenerateScriptProgressBar_Screenshot1, GenerateScriptProgressBar_Screenshot1_Options)== true) ||
(Validate.ContainsImage(progressbarInfo, GenerateScriptProgressBar_Screenshot3, GenerateScriptProgressBar_Screenshot3_Options)=true) )
{
Wait_For_STEP2(500, step2_screenshot);

}

it gives me an error saying boolean action cannot be performed for a validate.contains image.

Can you please help as to how i can introduce a validate.Contains image in while loop for evaluating it as 'currently existing' or true action?


Thanks

Re: Validating an image and using it in a while loop

Posted: Wed Nov 22, 2017 8:46 am
by odklizec
Hi,

In my opinion, you should forget about using screenshots for progress bar validation. From the snapshot you uploaded, it appears that the progress bar provides Value attribute? Which means, you can check and validate the actual progress, using numerical value, instead or relying on screenshots.