[Sikuli-driver] [Question #685372]: The script does not work
New question #685372 on Sikuli: https://answers.launchpad.net/sikuli/+question/685372 Hello colleagues! Sorry for such an elementary question. I don’t understand what am I doing wrong? Tell me how to cope with the following task: I installed “Sikuli 2.0.0” on Windows10 and try to run a small script in the Sikuli IDE: from sikuli import * openApp ("C: \\ Users \\ User \\ CALK \\ calk-pro_x64.exe") sleep (1) click ("btn1.png") sleep (1) hover ("ktrbtnyes.jpg") sleep (1) click ("ktrbtnyes.jpg") And instead of the expected result, I get a message: [log] CLICK on L [126,850] @S (0) (538 msec) [error] script [CAL] stopped with error in line 7 [error] FindFailed (ktrbtnyes.jpg: (1213x206) in R [0,0 1920x1080] @S (0)) [error] --- Traceback --- error source first line: module (function) statement 7: main () hover ("ktrbtnyes.jpg") [error] --- Traceback --- end -- I have java -version installed: openjdk version "11.0.3" 2019-04-16 OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.3 + 7) OpenJDK 64-Bit Server VM AdoptOpenJDK (build 11.0.3 + 7, mixed mode) I took screenshots of the buttons myself, and not through the “Screenshot” in the Sikuli IDE. However, I inserted the button names into the script through the "Insert Image" in the Sikuli IDE. What am I doing wrong? Where should I place the folder with my project "CAL"? What modules still need to be connected and how? And what does the string "7: main () hover (" ktrbtnyes.jpg ") mean? -- 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 #685372]: The script does not work
Question #685372 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/685372 Status: Open => Answered RaiMan proposed the following answer: #from sikuli import * # not needed in IDE main scripts# #openApp ("C: \\ Users \\ User \\ CALK \\ calk-pro_x64.exe") # no intermediate spaces # see docs for class App calc = App("C:\\Users\\User\\CALK\\calk-pro_x64.exe") calc.open() if not calc.isRunning(10): # wait max 10 seconds exit(1) # no sleeps needed, since search waits 3 seconds max for image click ("btn1.png") #hover ("ktrbtnyes.jpg") #does not make sense (click follows) click ("ktrbtnyes.jpg") Not sure, wether you have looked through the docs already: https://sikulix-2014.readthedocs.io/en/latest/index.html Depending on your monitor situation (HiDPI ?, scaling>100%?, ...) you might have problems with external snapshots see: https://bugs.launchpad.net/sikuli/+bug/1730645 It is highly recommended to take the images with the IDE. -- 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 #685372]: The script does not work
Question #685372 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/685372 Status: Answered => Open Paul Weber is still having a problem: RaiMan, thanks for the advice! I tried to do as you wrote. Error messages have disappeared. However, in line calc = App ("C: \\ Users \\ User \\ CALK \\ calk-pro_x64.exe") the name "App" is highlighted in red. I guess I forgot to connect the modules somewhere? What kind? And yet, the program starts, but until a certain point. When I run the executable file, UAC (User Account Control) starts. A UAC window opens with the question “Do you want to allow this application to make changes to your computer?” And two buttons appear: “Yes” and “No”. I need to click the "Yes" button. How to do this, but in order not to disable UAC and click on the “Yes” button? How this issue is resolved using SikuliX. I tried to achieve this result with the command: type (Key.TAB + Key.TAB + Key.ENTER), but I didn’t succeed ... Thanks in advance! -- 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 #685372]: The script does not work
Question #685372 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/685372 Status: Open => Needs information RaiMan requested more information: --- the name "App" is highlighted in red normal IDE syntax highlighting (red = SikuliX class) --- When I run the executable file, UAC (User Account Control) starts. Which executable are you talking about? calk-pro_x64.exe??? if yes: why is it asking such things? has nothing to do with SikuliX. --- type (Key.TAB + Key.TAB + Key.ENTER) type (Key.TAB) type (Key.TAB) type (Key.ENTER) is better, since you are now able to add short waits after each type to give time to the GUI (e.g. wait(0.3)) -- 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 #685372]: The script does not work
Question #685372 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/685372 Status: Needs information => Answered RaiMan proposed the following answer: ... and again calc = App ("C: \\ Users \\ User \\ CALK \\ calk-pro_x64.exe") as already mentioned all those interleaving spaces are neither helpful nor according to the script language rules. Spaces tend to make more problems then being helpful. calc = App("C:\\Users\\User\\CALK\\calk-pro_x64.exe") # this way -- 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