Want to run multiple scripts one after the other

Asked by vaibhav shejwal

Hi,
Can you please help me out, I am a new user of sikuli.
I have taken multiple test cases screen shots but now i have to run it sequentially.After the first .skl file runs then the next .skl file should start.
I had try by batch files but all scripts overlap and the error is occured.

i am using sikuli X 1.0rc3 on windows 7.

Question information

Language:
English Edit question
Status:
Solved
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Solved by:
RaiMan
Solved:
Last query:
Last reply:
Revision history for this message
Best RaiMan (raimund-hocke) said :
#1

First tip:
forget the executables. These are only zipped .sikuli folders and lack some features.
Just leave your scripts as .sikuli and use them the same way as the .skl.

--- want to run scripts one after the other
depending on your programming/scripting knowledge (especially Python) there are many possibilities to achieve that.

- most flexible - most challenging
use Pythons unittest feature (see faq )

- use import
and run the main script from command line

example:
- have all you scripts in one folder (script1.sikuli, script2.sikuli, ...)
- each script must have "from sikuli import *" as first line

- make a main.sikuli
# content:
import script1 # this runs the script
import script2

You have to run main.sikuli from command line using Sikuli-IDE.bat.
Or you can run it in Sikuli IDE, but only once (you have to exit/restart the IDE before running the script again).

(for more info: http://sikuli.org/docx/globals.html#importing-other-sikuli-scripts-reuse-code-and-images)

--- make a batch file with a for-loop
use the command
java -jar %SIKULI_HOME%\sikuli-script.jar some-script.sikuli
to run a script

and give a list of scripts as parameter

Revision history for this message
RaiMan (raimund-hocke) said :
#2

Sorry, the unittest faq is: faq 1804

Revision history for this message
vaibhav shejwal (hellov-09) said :
#3

thank you RaiMan.

Revision history for this message
vaibhav shejwal (hellov-09) said :
#4

Thanks RaiMan, that solved my question.