Re: [Sikuli-driver] [Question #189309]: For my second script, URL is not pasted properly
Question #189309 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/189309 Status: Answered = Solved Apoorv Gupta confirmed that the question is solved: Thanks RaiMan. By using - type(l, KeyModifier.CTRL) # lowercase L now test using address bar correctly. And i took your suggestion of running multiple test from sikuli IDE rather than command line. But the results are inconsistent i.e. sometimes 2nd test is not starting at all. The error which i got was: (read life cycle as script2) File C:\Users\apgupta\AppData\Local\Temp\sikuli-tmp8772765509183287214.py, line 4, in import LifeCycle File C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py, line 45, in load_module File C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py, line 27, in _load_module File C:\Program Files\Sikuli X\sikuli-script.jar\Lib\sikuli\SikuliImporter.py, line 27, in _load_module File F:\Sikuli\ALL_Test\LifeCycle.sikuli\LifeCycle.py, line 7, in I have posted a new question with few more quries. -- You received this question notification because you are a member of Sikuli Drivers, which 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 #189309]: For my second script, URL is not pasted properly
Question #189309 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/189309 RaiMan posted a new comment: You left out the error message, so it is hard to guess what happens. Check first, wether your script2 runs error free as standalone script. One more thing: If you run my import suggestion in the IDE, you have to restart the IDE each time you have changed something in the subs or you add a reload() to every import() (this is a known problem, since in IDE a rerun of a script does not start from scratch) import script1 reload(script1) -- You received this question notification because you are a member of Sikuli Drivers, which 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 #189309]: For my second script, URL is not pasted properly
Question #189309 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/189309 Description changed to: Hi, I started using Sikuli some time back and with the help of this site (Launchpad) I have been able to create 2 scripts which are running successfully when ran indivually. I have been trying to run both scripts one after another using a Master script. Master.script : import os dir = F:\\Sikuli\\ALL_Test scripts = [Script1, Script2] isPassAll = {} for script in scripts: isPass = True scriptPath = os.path.join(dir, script+.sikuli) setBundlePath(scriptPath) execfile(os.path.join(scriptPath, script+.py)) isPassAll[script] = isPass print isPassAll Script1: from sikuli import * openApp(C:\\Program Files\\Mozilla Firefox\\firefox.exe); wait(2) paste(server_URL) type(Key.ENTER); wait(25) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(20) click(New-1.png); wait(20) click(Pattern(Name-1.png).similar(0.92)) type(mylife) click(Pattern(1330346365484-1.png).similar(0.93)) click(Pattern(State-1.png).targetOffset(92,2)) type(Key.DOWN) type(Key.DOWN); wait(2) click(Pattern(Empty space.png).similar(0.98).targetOffset(21,6)) find(Approved is OK.png); wait(5) click(1330346752390-1.png); wait(10) click(Lifecycle_created.png); wait(5) click(Pattern(checkin.png).similar(0.92)); wait(7) click(Pattern(Checkin_OK.png).targetOffset(-9,117)); wait(10) click(Lifecycle_created.png); click(CheckOut-1.png); wait(5) click(Lifecycle_created.png); click(Undocheckout.png); wait(5) click(Lifecycle_created.png); click(Pattern(Ddete.png).similar(0.81)); wait(5) click(Pattern(Delete_Notice.png).targetOffset(58,77)); wait(5) App.close(Firefox) App.close(cmd) Script2: from sikuli import * openApp(C:\\Program Files\\Mozilla Firefox\\firefox.exe); wait(2); isPass = True paste(server_URL); isPass = True type(Key.ENTER); wait(5) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(5) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(10) find(Panel.png); wait(5); isPass = True App.close(Firefox) App.close(cmd) I am running following command from CMD : java -jar C:\Program Files\Sikuli X\sikuli-script.jar F:\Sikuli\ALL_Test\MASTER.sikuli My Script1.sikuli and Script2.sikuli are in same folder as MASTER.sikuli. The first test is running without ant issue, but for 2nd script when firefox is launched, Sikuli tries to paste the server URL but not in address bar and continues with rest of the script. I tried inserting image of address bar with click, but still failing. Any suggestions?? I am using Sikuli X 1.0rc3 (r905) on windows 7, 32 bit. Thanks in Advance. -- You received this question notification because you are a member of Sikuli Drivers, which 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 #189309]: For my second script, URL is not pasted properly
New question #189309 on Sikuli: https://answers.launchpad.net/sikuli/+question/189309 Hi, I started using Sikuli some time back and with the help of this site (Launchpad) I have been able to create 2 scripts which are running successfully when ran indivually. I have been trying to run both scripts one after another using a Master script. Master.script : import os dir = F:\\Sikuli\\ALL_Test scripts = [Script1, Script2] isPassAll = {} for script in scripts: isPass = True scriptPath = os.path.join(dir, script+.sikuli) setBundlePath(scriptPath) execfile(os.path.join(scriptPath, script+.py)) isPassAll[script] = isPass print isPassAll Script1: from sikuli import * openApp(C:\\Program Files\\Mozilla Firefox\\firefox.exe); wait(2) paste(server_URL) type(Key.ENTER); wait(25) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(20) click(New-1.png); wait(20) click(Pattern(Name-1.png).similar(0.92)) type(mylife) click(Pattern(1330346365484-1.png).similar(0.93)) click(Pattern(State-1.png).targetOffset(92,2)) type(Key.DOWN) type(Key.DOWN); wait(2) click(Pattern(Empty space.png).similar(0.98).targetOffset(21,6)) find(Approved is OK.png); wait(5) click(1330346752390-1.png); wait(10) click(Lifecycle_created.png); wait(5) click(Pattern(checkin.png).similar(0.92)); wait(7) click(Pattern(Checkin_OK.png).targetOffset(-9,117)); wait(10) click(Lifecycle_created.png); click(CheckOut-1.png); wait(5) click(Lifecycle_created.png); click(Undocheckout.png); wait(5) click(Lifecycle_created.png); click(Pattern(Ddete.png).similar(0.81)); wait(5) click(Pattern(Delete_Notice.png).targetOffset(58,77)); wait(5) App.close(Firefox) App.close(cmd) Script2: from sikuli import * openApp(C:\\Program Files\\Mozilla Firefox\\firefox.exe); wait(2); isPass = True paste(server_URL); isPass = True type(Key.ENTER); wait(5) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(5) type(wtadmin + Key.TAB) type(wtadmin + Key.ENTER); wait(10) find(Panel.png); wait(5); isPass = True App.close(Firefox) App.close(cmd) I am running following command from CMD : java -jar C:\Program Files\Sikuli X\sikuli-script.jar F:\Sikuli\ALL_Test\MASTER.sikuli My Script1.sikuli and Script2.sikuli are in same folder as MASTER.sikuli. The first test is running without ant issue, but for 2nd script when firefox is launched, Sikuli tries to paste the server URL but not in address bar and continues with rest of the script. I tried inserting image of address bar with click, but still failing. Any suggestions?? Thanks in Advance. -- You received this question notification because you are a member of Sikuli Drivers, which 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 #189309]: For my second script, URL is not pasted properly
Question #189309 on Sikuli changed: https://answers.launchpad.net/sikuli/+question/189309 Status: Open = Answered RaiMan proposed the following answer: --1. I think, App.close(cmd) does not make any sense if used in the master/sub configuration, because this will close the command window, that the master is running in. BTW 1: from sikuli import * is not needed in subs, if exec file is used. --- Better solution: If you decide to run master generally from command line and having all related .sikuli in one folder, this is better with current Sikuli X (the subs NEED from sikuli import * in this case): *** master.sikuli import script1 import script2 this will simply run both scripts one after the other. might make sense, to insert a wait, after a script has run: import script1 wait(3) # to give Firefox time to close import script2 --- passing variables back and force is no longer possible using just variables. with this solution You might use for example Sikuli's Settings class to define and access variables in master and all subs # e.g. in master Settings.myValue = True # and in sub: if Settings.myValue: print myValue is set --- So it is possible to decide, wether the sub is run as sub or standalone: # in master: Settings.runningAsSub = True # and in sub from sikuli import * try: isSub = Settings.runningAsSub except: isSub = False if not isSub: pass # start Firefox else: pass # supposing FF already running --- One more thing: With newer versions of Firefox, closing a FF window might not close the FF process. To access the address field you might use type(l, KeyModifier.CTRL) # lowercase L -- You received this question notification because you are a member of Sikuli Drivers, which 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