← Back to team overview

sikuli-driver team mailing list archive

[Question #692037]: How to check that there is no image?

 

New question #692037 on Sikuli:
https://answers.launchpad.net/sikuli/+question/692037

Hello,
I have an horizontal container where are displayed several images. A known image is displayed in the middle of the container
I want to go to begining on the list, i.e. the first image is then displayed on the middle of the container and so, I have nothing more on the left, only the background.

So this is my code:

    # Look for the known image displayed at the middle
    m = appRegion.find("known_image.png")

    # position of the prevProg, where I have to click to make images to shift one step on the right and also where I have to find the background at the end.
    prevProg = m.offset(-171, 0)

    while not prevProg.exists("background.png", 1):
        click(m.getCenter().offset(-173, 0))
 
So I can see that on each iteration, images are shifting one step on the right as expected and so, when reaching the begining of the list, I was expected that prevProg.exists("background.png", 1) becomes true. I verified with match preview that the background is recognized.
Anyway, I never exit the loop. Why?



-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.