← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #213704]: click( img ) not working..

 

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

    Status: Needs information => Answered

RaiMan proposed the following answer:
This is what you are doing:
Y - this is the region somewhere on the screen resulting from the first find (Region_Menu_Guide)
x - this is the region you are constructing based on Region_Menu_Guide

xxxxxxxxxxxxxxxxxxxxYYYYYYYYYxxxxxxxxxx
x                                      Y                 Y                  x
x                                      Y                 Y                  x
x                                      Y YYYYYYYY                  x
x                                                                              x
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

So since this works at all (you say the click works),then already the first find was successful.
The only difference between 
click(Pattern("KuA4IITEErat.png").similar(0.83).targetOffset(-2,-22))

and
Region_Menu_Guide=find(Pattern("KuA4IITEErat.png").similar(0.83).targetOffset(-2,-22))
Region_Menu=Region(Region_Menu_Guide).left(200)
Region_Menu.setH(600) # setting New region height by 600
Region_Menu.setW(600) # setting new region width by 600
Region_Menu.click(Pattern("KuA4IITEErat.png").similar(0.83).targetOffset(-2,-22))

that some more time elapses (somewhat between 0.5 and 1 second) after
the first find and the final click().

So this should do the same:
wait(1)
click(Pattern("KuA4IITEErat.png").similar(0.83).targetOffset(-2,-22))

which only means, that you have to wait a little after the last action
(seems to be a click too: question: [log] CLICK on (403,558) ) before
trying to click again (this is what I meant with timing problems above).

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