← Back to team overview

sikuli-driver team mailing list archive

[Question #238004]: Click() function fails to click on image name passed to it parameter of list element

 

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

I want to be able to pass certain parameters to sikuli script such as images to be clicked on or text to be typed from a "config" file as this information can vary from person to person. When I try to do so in my script, I keep getting "FindFailed(Text Search currently switched off)" error. However, I have included "Settings.OcrTextSearch = True" in the script. I have provided part of the code below. If  additional info is needed, please contact me.

#code
Settings.OcrTextSearch = True
Settings.OcrTextRead = True

#open the config file and read the contents
fin = open("C:\Users\Administrator\Desktop\Sikuli\configure_iOS_MX.txt", "r")
lines = fin.readlines()
fin.close()
n = 0
var = [ ]
for line in lines:
   var.append(line)
   n = n + 1

click(var[0]) 

The script fails here and gives the error message provided above. "var[0]" contains the name of the image file located in same directory as the sikuli script. eg: "img1.png" (including double quotes). Moreover, I have also checked on the "allow searching for text" and "allow OCR" in the "Preferences: more options" for Sikuli. I am using Sikuli IDE 1.0.1 on Windows 2008 64 bit system. Please reply asap as until this issue gets resolved, I can't proceed further. Thanks.



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