← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #245842]: Perform validations using the sikuli

 

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

    Status: Open => Answered

obiwan-92 proposed the following answer:
Hello.

I see. :)
So, in this case you have a third way.

If I take your example with the calculator, I can do it with this :
click("b5.png") # Click on "5"
click("bp.png") # Click on "+"
click("b1.png") # Click on "1"
click("be.png") # Click on "="
# Normally 6 is now display in the calulator
doubleClick(Pattern("help.png").targetOffset(0,20)) 
# I use the help button like a reference to select with a double click the result field
type('c', KeyModifier.CTRL) # I copy the result in the clipboard
result = Env.getClipboard() # I get the result from the clipboard.
if result == 6: print "OK" # if the result is correct
else: print "Error" # if the result is not

Best regards.

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