← Back to team overview

sikuli-driver team mailing list archive

[Question #252079]: 'TextSearch turned off' error if image does not appear on screen before timeout; how to handle this error?

 

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

in other words, i want for it to be okay if the image is not found on the screen every time

in my code i have a class for images.

for every new image i instantiate an object of that class.

that object is used in click() and things like that.

if the image is on screen or appears before the time out, it works great!

but when the image does not appear,  i get the textsearch switched off error...but im not using text search....

class image()
 def __init__(image_url, timer=10)
self.image = image_url
self.timer = timer
self.pattern = self.image_pattern()

def image_pattern(self):
return Pattern(self.image)

def get(self):
image_match = SCREEN.exists(self.pattern, self.timer)
if not image_match: return failed
else: return image_match


to instantiate:

my_image = image('/home/kyoung/images/image.png',  10)

then for a click

click(my_image.get())

i typed this from memory and i know some syntax was wrong but trust me its not a syntax error how do i handle it if the image is not on screen?

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