Run multiple scripts in single go

Asked by Jaspreet Singh

Hello,

I have two questions.

1)Can you please tell me procedure to run several scripts in single go.
For example , I have created below scripts
script1.sikuli
script2.sikuli
script3.sikuli
script4.sikuli
script5.sikuli

now I want to make a test suite which contains all the scripts five scripts, scripts should run serially (one after another) without any human interference.?

2) I want to check which script is Pass and which is Failed. Can you please tell me how to check this once serial execution is finished.?

Thanks in advance ..!
Jaspreet

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

--- This is a generalized main script, that runs the given scripts one after another.

import os
dir = "absolute-path-to-directory-containing-the-scripts"
scripts = ["script1", "script2", "script3", "script4", "script5"]
isPassAll = {}

for script in scripts:
    isPass = False
    scriptPath = os.path.join(dir, script+".sikuli")
    setBundlePath(scriptPath)
    execfile(os.path.join(scriptPath, script+".py")
    isPassAll[script] = isPass
print isPassAll

--- to get the feedback from each step, inside the script set isPass to True, if the test step passed, otherwise the preset of False will be registered

hope it helps

Revision history for this message
Jaspreet Singh (js-sabharwal) said :
#2

Thanks RaiMan, that solved my question.

Revision history for this message
Jaspreet Singh (js-sabharwal) said :
#3

Great help ..! Thanks a ton Rai ..!