[Sikuli-driver] [Question #293847]: How to gracefully interrupt running script when using SwingWorker and JFrame?
New question #293847 on Sikuli: https://answers.launchpad.net/sikuli/+question/293847 Thanks to the help provided here I've created a JFrame to allow me more advanced user interaction and a custom control GUI. I only have one issue at this point, once the items runing in doInBackground (BgTask SwingWorker), you can not gracefully stop stop the script. I get the following error: java.lang.InterruptedException: sleep interrupted which I assume happens due to me trying to interrupt the 'wait' command. I tried to add a try/except to catch the exception, but it doesn't seem to work. Also when I try to use the CTRL+ALT+c hot key it stops the program and makes my JFrame and also the IDE unresponsive. I'm using Windows 7 64bit, I'm using SikulixIDE 1.1.0 CODE: from javax.swing import JButton, JFrame, JTextField, JPanel from java.lang import Runnable, InterruptedException from java.util.concurrent import ExecutionException from javax.swing import SwingWorker, SwingUtilities from java.lang import * from java.awt.event import ActionListener, WindowAdapter import threading class BgTask(SwingWorker): def __init__(self, gui): self.gui = gui SwingWorker.__init__(self) def doInBackground(self): try: click("1463505602802.png") #Random icon on my desktop that is visible wait(5) click("1463514867811.png") #Random icon on my desktop that is visible except InterruptedException: print "***Automation Stuff Should End***" def done(self): try: self.get() except ExecutionException, e: raise SystemExit, e.getCause() # print e.getCause() class Example: def _setButtonStates(self, started): self.stopBtn.enabled = started self.startBtn.enabled = not started def stopSomething(self, event): self.bgTask.cancel(True) self.bgTask = None self._setButtonStates(started=False) def doSomething(self,event): self.bgTask = BgTask(self) self.bgTask.execute() self._setButtonStates(started=True) def __init__(self): frame = JFrame("Gamma Automated Testing") frame.setSize(200, 150) frame.addWindowListener(Adapter()) frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE) pnl=JPanel() frame.add(pnl) self.textfield1 = JTextField('', 15) pnl.add(self.textfield1) self.textfield2 = JTextField('', 15) pnl.add(self.textfield2) self.startBtn = JButton('Start Automation', actionPerformed=self.doSomething) self.stopBtn = JButton('Stop', actionPerformed=self.stopSomething) pnl.add(self.startBtn) pnl.add(self.stopBtn) self.stopBtn.enabled = False frame.pack() frame.setVisible(True) endCondition = threading.Condition() class Adapter(WindowAdapter): def windowClosing(self, event): endCondition.acquire() endCondition.notifyAll() endCondition.release() class Runnable(Runnable): def __init__(self, runFunction): self._runFunction = runFunction def run(self): self._runFunction() if __name__ == '__main__': SwingUtilities.invokeLater(Runnable(Example)) endCondition.acquire() #Example() endCondition.wait() endCondition.release() -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #291572]: "FindFailed" popups for cmd.exe batch files
Question #291572 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/291572 Status: Answered => Solved Peter O'Keefe confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #293839]: Certain screenshots not recognized when passed between testers
New question #293839 on Sikuli: https://answers.launchpad.net/sikuli/+question/293839 We have a team of four QA testers authoring our Sikuli scripts. In general, we have no problem passing the scripts from one tester to another- the scripts authored by one user work on another's computer, the screenshots taken by one person work for everyone else. We ARE running into challenges with screenshots of our dropdown menus, though. The patterns are very basic- one line of copy in a dropdown- or more complex- screenshot of the entire dropdown, with the desired item targeted with Target Offset. With both the simple and complex versions of the patterns, the click(dropdown_screenshot) commands work fine on our local computers, BUT the patterns are unrecognized on each other's (matching tolerances need to be dropped to 30-50% to get a match). Additional info: - Some testers snapped their dropdown selection screenshots directly from the webpage - Some testers first captured the dropdown content with Snaggit, and then Sikuli-screenshot the Snaggit image - All dropdown selection screenshots retained their default image name - All monitor resolutions and sizes are the same - If one tester pastes their dropdown selection screenshot into another user's script, the script passes as expected - All other screenshots are working fine across users Thanks for any insight or advice! Not sure if this is a defect, or user error, or what- though user error on our behalf is the most likely culprit :) -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 769837] Re: [1.0.1] Env.getClipboard() seems to work only once and does not access real clipboard anymore after using paste()
** Also affects: juno Importance: Undecided Status: New -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/769837 Title: [1.0.1] Env.getClipboard() seems to work only once and does not access real clipboard anymore after using paste() Status in Juno: New Status in Sikuli: In Progress Bug description: --1. I use Interactive Sikuli Jython Session to do all this, if I relaunch it and check Env.getClipboard it has the new content. So it seems like Env.getClipboard only gets updated at the start. --2. After using paste() the first time, Env.getClipboard() only returns the last pasted content, no matter what the "real" clipboard may contain. - I'm trying to get a few lines of text into variables in a for loop using Env.getClipboard() but it only works on the first loop. On the second loopiteration Env.getClipboard seems to always return the last value of the first one. I've checked the clipboard and the values are being correctly copied. Any ideia what might be causing this? runing v. X-1.0rc2 Mac OS 10.6.7 Thanks in advance. To manage notifications about this bug go to: https://bugs.launchpad.net/juno/+bug/769837/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293782]: getImagePath on Windows
Question #293782 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293782 Status: Answered => Solved Karl confirmed that the question is solved: Thanks RaiMan, that solved my question. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1556195] Re: [1.1.0] Can't open app directly from IDE on OS X
@Kristof ;-) thanks for the evaluation. I will test it as soon as possible. ** Changed in: sikuli Importance: Medium => High -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1556195 Title: [1.1.0] Can't open app directly from IDE on OS X Status in Sikuli: In Progress Bug description: Environment: OS X 10.11.3 SikuliX IDE 1.1.0 Build 2015-10-05_17:07 JDK 8u73 When I run .sikuli script directly from SikuliX IDE opened app immediately exits For example, script contains: myApp = App("Firefox") myApp.open() When I try to run the script from IDE I can see Firefox app's icon blinks for a second in Dock and then disappears. The same happens with openApp("Firefox") or switchApp("Firefox") commands. If I run this .sikuli file directly from command line "/Applications/SikuliX.app/run -r ~/Applications/SikuliX/scripts/firefox.sikuli/" - it works correctly. The issue doesn't reproduce with common OS X apps (I tried Safari, TextEdit, Terminal, Calculator etc.). But it reproduces with non-common OS X apps (I tried FireFox, TextWrangler, Microsoft Word etc.) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1556195/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293772]: Error while running mvn -pl Setup exec:exec
Question #293772 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293772 RaiMan proposed the following answer: all info is either on github or on sikulix.com. stackoverflow is always worth a visit too. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293827]: "hidden=True" to argument of input(), None is not returned.
Question #293827 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293827 Status: Open => Answered RaiMan proposed the following answer: have to check. thanks. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1582782] [NEW] [1.1.0] Windows: getImagePath not useable with os.path.join
Public bug reported: Why do image paths from getImagePath start with a forward slash? ** Affects: sikuli Importance: High Assignee: RaiMan (raimund-hocke) Status: In Progress ** Changed in: sikuli Status: New => In Progress ** Changed in: sikuli Importance: Undecided => High ** Changed in: sikuli Assignee: (unassigned) => RaiMan (raimund-hocke) ** Changed in: sikuli Milestone: None => 1.1.1 -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1582782 Title: [1.1.0] Windows: getImagePath not useable with os.path.join Status in Sikuli: In Progress Bug description: Why do image paths from getImagePath start with a forward slash? To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1582782/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #293782]: Status of bug #1582782 changed to 'In Progress' in Sikuli
Bug #1582782 status changed in Sikuli: New => In Progress https://bugs.launchpad.net/sikuli/+bug/1582782 "[1.1.0] Windows: getImagePath not useable with os.path.join" This bug is linked to #293782. getImagePath on Windows https://answers.launchpad.net/sikuli/+question/293782 -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293782]: getImagePath on Windows
Question #293782 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293782 Linked to bug: #1582782 https://bugs.launchpad.net/bugs/1582782 "[1.1.0] Windows: getImagePath not useable with os.path.join" -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293782]: getImagePath on Windows
Question #293782 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293782 Status: Needs information => Answered RaiMan proposed the following answer: ok, I put it on the list for the next tests on Windows. -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #293827]: "hidden=True" to argument of input(), None is not returned.
New question #293827 on Sikuli: https://answers.launchpad.net/sikuli/+question/293827 When I pressed the Cancel button or closed the dialog, None is not returned. Is this a bug? -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293807]: how can I transfer parameter when run sikuli through cmd line
Question #293807 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293807 Status: Open => Answered masuo proposed the following answer: http://sikulix-2014.readthedocs.io/en/latest/faq/010-command-line.html?highlight=command -- runsikulix.cmd -r test.skl -- abc You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1582611] Re: mac can't run ide - NoClassDef - EventObserver
Hello, The problem seems fixed. I re-ran the setup (java -jar sikulixsetup-1.1.0.jar), and I answered "No" every time setup asked if I wanted to use the existing library. At end of setup, the IDE works. -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1582611 Title: mac can't run ide - NoClassDef - EventObserver Status in Sikuli: New Bug description: Hello, - On Mac 10.11.2, after following install instructions on http://www.sikulix.com/quickstart.html, - move SikuliX.app to Applications. - double-click SikuliX --> nothing happens - in terminal, run ./runsikulix --> running SikuliX: /Applications/SikuliX.app/Contents/Java/sikulix.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/sikuli/util/EventObserver at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.sikuli.ide.Sikulix.main(Sikulix.java:21) Caused by: java.lang.ClassNotFoundException: org.sikuli.util.EventObserver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 13 more I cannot run the IDE. Mac 10.11.2 64-bit SikuliX 1.1.0 thanks. To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1582611/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1582611] [NEW] mac can't run ide - NoClassDef - EventObserver
Public bug reported: Hello, - On Mac 10.11.2, after following install instructions on http://www.sikulix.com/quickstart.html, - move SikuliX.app to Applications. - double-click SikuliX --> nothing happens - in terminal, run ./runsikulix --> running SikuliX: /Applications/SikuliX.app/Contents/Java/sikulix.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/sikuli/util/EventObserver at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.sikuli.ide.Sikulix.main(Sikulix.java:21) Caused by: java.lang.ClassNotFoundException: org.sikuli.util.EventObserver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 13 more I cannot run the IDE. Mac 10.11.2 64-bit SikuliX 1.1.0 thanks. ** Affects: sikuli Importance: Undecided Status: New -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1582611 Title: mac can't run ide - NoClassDef - EventObserver Status in Sikuli: New Bug description: Hello, - On Mac 10.11.2, after following install instructions on http://www.sikulix.com/quickstart.html, - move SikuliX.app to Applications. - double-click SikuliX --> nothing happens - in terminal, run ./runsikulix --> running SikuliX: /Applications/SikuliX.app/Contents/Java/sikulix.jar Exception in thread "main" java.lang.NoClassDefFoundError: org/sikuli/util/EventObserver at java.lang.ClassLoader.defineClass1(Native Method) at java.lang.ClassLoader.defineClass(ClassLoader.java:760) at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) at java.net.URLClassLoader.defineClass(URLClassLoader.java:467) at java.net.URLClassLoader.access$100(URLClassLoader.java:73) at java.net.URLClassLoader$1.run(URLClassLoader.java:368) at java.net.URLClassLoader$1.run(URLClassLoader.java:362) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:361) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) at org.sikuli.ide.Sikulix.main(Sikulix.java:21) Caused by: java.lang.ClassNotFoundException: org.sikuli.util.EventObserver at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 13 more I cannot run the IDE. Mac 10.11.2 64-bit SikuliX 1.1.0 thanks. To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1582611/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Bug 1556195] Re: [1.1.0] Can't open app directly from IDE on OS X
Hi It is problem in new El-Captain version. Sikuli run Application using osascript: osascript -e 'tell app "Application" to activate' It working from terminal, but not from python subprocess cmd=['osascript','-e','tell app "Firefox" to activate'] subprocess.Popen([cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate() It is becouse it is running not as logged user, and don't have acces to GUI. It can be fixed adding "sudo" cmd=['sudo','-u','LoggedUserName','osascript','-e','tell app "Firefox" to activate'] subprocess.Popen([cmd,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate() In next step You can make switchApp myApp=switchApp("Firefox") args=['sudo','-u',user,'osascript','-e','tell app "Firefox"\n activate\n end tell'] It is problem with the user who run firefox it is not You, and he don't access to gui components. You must add "sudo" user='YourName' args=['sudo','-u',user,'osascript','-e','tell app "Firefox"\n activate\n end tell'] subprocess.Popen(args,stdout=subprocess.PIPE,stderr=subprocess.PIPE).communicate() wait(2) myApp=switchApp("Firefox") -- You received this bug notification because you are a member of Sikuli Drivers, which is subscribed to Sikuli. https://bugs.launchpad.net/bugs/1556195 Title: [1.1.0] Can't open app directly from IDE on OS X Status in Sikuli: In Progress Bug description: Environment: OS X 10.11.3 SikuliX IDE 1.1.0 Build 2015-10-05_17:07 JDK 8u73 When I run .sikuli script directly from SikuliX IDE opened app immediately exits For example, script contains: myApp = App("Firefox") myApp.open() When I try to run the script from IDE I can see Firefox app's icon blinks for a second in Dock and then disappears. The same happens with openApp("Firefox") or switchApp("Firefox") commands. If I run this .sikuli file directly from command line "/Applications/SikuliX.app/run -r ~/Applications/SikuliX/scripts/firefox.sikuli/" - it works correctly. The issue doesn't reproduce with common OS X apps (I tried Safari, TextEdit, Terminal, Calculator etc.). But it reproduces with non-common OS X apps (I tried FireFox, TextWrangler, Microsoft Word etc.) To manage notifications about this bug go to: https://bugs.launchpad.net/sikuli/+bug/1556195/+subscriptions ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
[Sikuli-driver] [Question #293807]: how can I transfer parameter when run sikuli through cmd line
New question #293807 on Sikuli: https://answers.launchpad.net/sikuli/+question/293807 I want to run sikuli through cmd line and tranfer parameter to the sikuli, how can i realize? now i write this in cmd line: runsikulix.cmd -r test.skl abc , it works wrong in test.skl , i use sys.argv[1] to accept the parameter as python -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp
Re: [Sikuli-driver] [Question #293741]: SikuliX Scripts for Bluestacks
Question #293741 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/293741 Status: Open => Answered Roman Podolyan proposed the following answer: 1) import random Python module 2) get location of top left corner 3) compute random offsets 4) add random offset to top left location coordinates to computer new random location withing given boundaries # taken out of my old working code, modified to illustrate example with given data import random ... # we know where top left corner is topleft = Location (744,1043) # 799 - 744 = 55 and we need random X offset x_offset = random.randint(0,55) # 1077 - 1043 = 34 and we need random Y offset y_offset = random.randint(0,34) click(topleft.right(x).below(y)) -- You received this question notification because your team Sikuli Drivers is an answer contact for Sikuli. ___ Mailing list: https://launchpad.net/~sikuli-driver Post to : sikuli-driver@lists.launchpad.net Unsubscribe : https://launchpad.net/~sikuli-driver More help : https://help.launchpad.net/ListHelp