← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #204776]: Localization testing

 

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

    Status: Open => Answered

RaiMan proposed the following answer:
--- import
if the main script and the imported scripts are in the same folder, the import works without the need to manipulate sys.path before.
But be aware: If you test in the IDE and change imported scripts, you have to either restart the IDE or use the following sequence:

import sub
reload(sub)
from sub import *

Do not use any special characters in the Sikuli script names, just
characters and numbers (e.g. camel case).

from sikuli import * # is not needed in a main script - only in subs,
that use Sikuli features

--- automate tests with different locale 
You should plan, to run your tests from command line, so you can use parameters.

path-to-Sikuli-IDE.bat -r path-to-main.sikuli --args "de-de"

in the main script:

locale = sys.argv[1]
print "running test with "+locale

impStatement = "from images-%s import *"%(locale)
exec(impStatement) # executes the built import statement

# now start your app and select the locale accordingly

with this approach, you would have a batch, that has one script run for
every locale as needed.

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