← Back to team overview

sikuli-driver team mailing list archive

[Question #148439]: exists() finds patterns that are not there

 

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

Hi!

I've been working on a script that opens the calculator, presses a few buttons and checks that the answer is correct (for tutorial).
The problem is that exists() doesn't seem to tell the difference between similar patterns.
The script looks like this:

 def testCalc(self):
	click("image-of-5-button")
	display =  "region-of-calc-display"
	if display.exists("image-of-display-displaying-15"): 
		print("Something is wrong"); return False
	else: 
                print("It's all good."); return True

It works if I change the if-condition to

        if display.exists("image-of-display-displaying-15").getScore() > 0.8:

However, then a new problem arises, should exists() ever return "None".

Do you have any ideas on how to solve this? :) Have I been using exists() wrong?
//Elisabeth

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