Example about how to integrate Sikuli in Python unit test suite

Asked by Lucio

Hi,

I am using Python and Selenium to learn how to test web apps, but for testing apps other than the ones running in a browser, I did discover Sikuli.

Now, I would like to integrate it to perform tests, in a python unit test suite; although I am having problems to understand how can I integrate it, so the test will be performed and based on the outcome, I can trigger an exception in my unit tests.

So far I did install it, made a simple test that access the menu bar in iTunes, but now I would like to integrate it in my pyhton test suite.
Could you please point me to an example or description about how can I actually achieve my objective? Ideally I would like to create the scripts with the IDE, and then save them in a location , and have Python drive the whole thing, marking pass or fail based on which script is passing or failing.

I want to run on both Windows and OSX; but I think the implementation should be the same. Thanks in advance.

Question information

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

These are your options:
- switch your work completely to the usage of Jython 2.7 (Java based Python, used in SikuliX)
- use a Python/Java bridging library to directly access the SikuliX Java API
- run SikuliX scripts from Python in a subprocess
- have a look at https://github.com/glitchassassin/lackey

Sorry, but for none of these options I have any examples, but you might find stuff in the net especially on stackoverflow.

Revision history for this message
Lucio (theshinyknight) said :
#2

Thanks for the reply, Raiman; I am exploring Lackey and subprocess; which seems the fastest way.

I have already a ton of other bits and moving parts, so I really prefer to avoid to implement all in Jython, and I was not lucky to find a bridging library. trying subprocess first. Thanks!

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

understood and agreed.
all the best.