views:

106

answers:

3

I'm extensively using Selenium for integration testing. Works great for all normal stuff (HTML/AJAX), but no go when I'm trying to test third party ActiveX, Java applets and Flash components.

The solution I've found for this is Sikuli. Works great locally, but how can I integrate that into Selenium?

btw. if that's relevant, for Selenium I'm using Python API.

A: 

I don't think there is a way to integrate both. AFAIK Sikuli does not have a command line interface or any kind of API.

FWIW, we use the iMacros Enterprise Bundle for our Flash/AJAX testing, it has similar image recognition features as Sikuli. So it is kind of a mixture of Sikuli and Seleninum. Easy to use, but it is a commercial solution. So I am not sure if that is an option for you.

SamMeiers
Actually Sikuli can be run from CLI. As for API, the scripts are Python.
vartec
+1  A: 

See the Python section of the Selenium RC documentation: http://seleniumhq.org/docs/05_selenium_rc.html#python

You may be able to run Selenium tests from Jython. In that case, you can simply integrate Selenium scripts into your Sikuli scripts.

Try the following in the Sikuli IDE. You may need to modify the import statements to point to specific files in the Selenium project.

from selenium import selenium    # this will probably need tweaking...

slm = selenium("localhost", 4444, "*firefox", "http://www.google.com/")
slm.start()
# etc...

This guy appears to have had success controlling Selenium from Jython: http://adam.goucher.ca/?p=367

My conclusion: it will probably be easiest to stay in Jython and control Selenium from there. You could integrate both tools into a single script.

Roy Tinker
Interesting direction for me is integrating Sikuli into Selenium, not other way around. Sikuli doesn't have any tooling like RC and Grid. Anyway, from Jython theoretically it's possible to invoke sikuli-script. I had some success with that on Linux, but on Windows and OSX it was dependency hell. Either way, quite nice suggestion, +1 for that. Although I think if I even suggest migrating all our Selenium infrastructure to Jython, SysEng guys will lynch me ;-P
vartec
A: 

You can extend the Selenium Server so it will be able to execute SIKULI scripts (see this on how to call them from Java).

However you will need to develop in Java as Selenium Server is a Java app.

ZloiAdun