How to call another script/file in main program

Asked by lynn

Says if I have fileA, fileB and fileC, which are used to implement different part of the testing.
And in main script, I want to call fileA, fileB, fileC in different sequnce, maybe on version1, need to call as fileA-fileB-fileC, then change to version2, need to call as fileB-fileA-fileC etc.

How to do in in Sikuli? Thanks

Question information

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

search in this forum for solutions for this often asked question.

... and you should be familiar with the respective Python features (supposing you are scripting with the SikuliIDE) and have understood this: http://sikulix-2014.readthedocs.org/en/latest/scripting.html#importing-other-sikuli-scripts-reuse-code-and-images

On the other hand: you are talking about testing:
so what about using Pythons's unittest feature?

see faq 1804

Revision history for this message
lynn (lynn-wu) said :
#2

thanks for your answer, and I tried below command as

myScriptPath="/home/lynn"
addImportPath(myScriptPath)

while I got error to say [error] NameError (name 'addImportPath' is not defined)
Can you help on it?

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

you are not using version 1.1.0

how to solve this in earlier versions read further in the above mentioned docs.

Can you help with this problem?

Provide an answer of your own, or ask lynn for more information if necessary.

To post a message you must log in.