Use strings to import and run functions from other Sikuli scripts
Hello everybody!
I am very impressed by Sikuli so far, and now I would like to use it for a huge testing.
Therefore I have created multiple .sikuli-
per SubTest.
I have imported the other SubTests fine and can run them with no problem so far in the "Main"-Test-File.
But now I would like to optimize this further:
I would like to realize it that I only have to create a new SubTest (e.g. TestCase23.sikuli in a subdirectory of the "Main"-
The rest should work automatically (that the Main-File calls the new SubTest and runs the tests there).
E.g.:
In the Main-File:
---
modulesToRun = ("InitSystem"
tempVar = modulesToRun # Create copy as the for-statement empties the variable
for f in tempVar:
import f # Import all SubModules
.... # some other code
.... # some other code
tempVar = modulesToRun # Create copy as the for-statement empties the variable
for f in modulesToRun:
f.RunMe() # Run all the tests per SubModule
---
How can I tell sikuli to treat "f" as an imported modulename for the "RunMe()"-call?
Then I would have a "RunMe()"-function in all SubModules and call all the Tests inside that module from there.
I hope I could explain a little bit, what I am trying to achieve ;-)
I would be greateful for any help!
Thanks a lot and best regards,
Chris
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- CryoGenID
- Solved:
- Last query:
- Last reply:
This question was reopened
- by CryoGenID