sikuli-driver team mailing list archive
-
sikuli-driver team
-
Mailing list archive
-
Message #11410
Re: [Question #201585]: Need to hover before click
Question #201585 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/201585
Status: Open => Answered
RaiMan proposed the following answer:
this is a timing problem I guess:
after having clicked image1 you have to wait a short time, since Sikuli
at the start of a search, which might last up to 1.5 seconds on the
whole screen, takes a screenshot internally, that is searched for the
image. So in your case this happens directly after the click(image 1)
and at this time, the screen is not yet white and hence image 2 is still
visible.
adding the hover(image 2) in the second case, inserts such a "wait", so
that the following click fails, since it now searches image2 again on
the white screen.
So I suggest the following (I hate try/except ;-)
click(image1)
wait(1)
if exists(image2, 0): # only one search, come back immediately, do not wait 3 seconds
click(getLastMatch()) # this should not happen
else:
popup("default")
--
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.