I would like to execute the body of a while if an image exists on the page.
The first line in the body of the while would be xClick imageToBeFound…png
But I cannot figure out how to make the while expression be true/false if the “imageToBeFound” exists.
I’m looking for something like “while visualVerify imageToBeFound” but when I use that I get an error “Unexpected token”.
I guess part of my problem is I cannot find any documentation on syntax within UIV. Do I have to enclose something in quotes or parenthesis or some kind of brace?
I used a work-around. I stored a local variable ‘true’ before entering the while loop. The while checks that variable, then I re-set that local variable before the end of the while loop.
The re-setting of the local variable is to check if an image exists:
The problem I see is it throws an error when the image no longer exists. “warningExists” is updated properly and the macro exits, but how can I avoid getting the error? (Or is it meant to just ignore such errors?)
Should I be using a different way to set the “warningExists” variable?