← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #155858]: 1.0 rc2 Sikuli command line tool can not execute sikuli scripts one by one

 

Question #155858 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/155858

    Status: Open => Answered

RaiMan proposed the following answer:
I will analyze the situation later on.

An alternative approach would be, to make one main .sikuli, that is
processed and uses import to execute the tests once:

# main.sikuli
sys.path.append(r"c:\Sikuli") 
# mind the lowercase r for raw string
# no need for double \
import test1
import test2
import test3

The only needed modification: each test script has to have as first line
from sikuli.Sikuli import *

This definitely processes each test one after the other and works, as
long as every test needs to run only once during one processing of main.

If main is run interactively in the IDE, the tests will only run once,
since the imported code is only processed the first time, when it is
imported. To run it again, you have to restart the IDE. This is true (as
for all imports), if something is changed in the imported scripts. But
from command line this is no problem, since each run of main starts from
scratch.

-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.