← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #245298]: How to handle enable/Disbale state of the button

 

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

    Status: Open => Answered

Eugene S proposed the following answer:
Hi,

What about creating a pattern for each one of the states and then try to find each one?
For example

if exists("ButtonState1.png"):
   print "The button state is 1"
   # Additional action for that case
elif exists("ButtonState2.png")
   print "The button state is 1"
   # Additional action for that case
else:
   # Additional action for that case


Or alternatively create just one pattern and use something like this:

try:
   find("ButtonState1.png")
   print "The button state is 1"
   #Additional action
except:
   print "State 1 button was not found"
   #Additional action


Eugene

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