← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #204354]: Use testing methods in Eclipse

 

Question #204354 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/204354

    Status: Answered => Open

Martin D is still having a problem:
Oh. I see. Yes, using exists() doesn't give me exceptions anymore.
However, it always goes to the else case and I don't even know why,
because the image is definitely there.

Here is my code sample:

from sikuli.Sikuli import *
from sikuli.SikuliTest import *
import os

switchApp("Safari")
addImagePath(r"/path/to/screens/")
reg = Region(0, 0, 1280, 800)
if reg.exists(Pattern("test2.png").similar(0.2)):
    print "found"
else:
    print "not_found"

 I even set the "similar" method to 0.000001 and it still jumps to the
else case.

And the "test2.png" is just a screenshot of the Safari app. I is the
exact same picture. The only difference is that my region is my whole
screen, therefore I have the menu bar on top, but that is only like 5%
of the picture. That's why I used the similar method, however, it
doesn't seem to work. Changing similar to 0 will print out "found" of
course.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.