← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #687686]: Random click region (no images)

 

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

    Status: Open => Answered

Manfred Hampl proposed the following answer:
Location is a position on the screen, not necessarily in your region, and its position is relative to the screen corner.
see https://sikulix-2014.readthedocs.io/en/latest/location.html

Try

locx = r.x + int(r.w * random.random())
locy = r.y + int(r.h * random.random())
click(Location(locx, locy))

-- 
You received this question notification because your team Sikuli Drivers
is an answer contact for Sikuli.