Sikuli Integration

After spending an entire day trying to work out how to integrate Sikuli into Katalon I admit defeat.
I’ve Googled “Katalon Sikuli” and tried every single example I can see, but each one gives me a different error, so now I’m at a loss.
Please could anyone provide me a working example and tell me which jar(s) I really do need and where to find it? I’ve now got more jars than a jam maker, and a headache that would kill a buffalo!
Thanks!

1 Like

Update… I’m happy to say that after a lot of research, trial and error, I’ve managed to get Sikuli working with Katalon Studio. The main issue was that Sikuli uses JNA (Java Native Access) version 5, whereas Katalon internally uses version 4. Hopefully it won’t break anything by doing this, but I simply deleted jna-4.1.0.jar and jna-platform-4.1.0.jar in Katalon’s configuration/resources/lib folder, and replaced them with jna-5.7.0.jar and jna-platform-5.7.0.jar and now everything is working as expected.

Here are the links to download the new versions:
https://repo1.maven.org/maven2/net/java/dev/jna/jna/5.7.0/jna-5.7.0.jar
https://repo1.maven.org/maven2/net/java/dev/jna/jna-platform/5.7.0/jna-platform-5.7.0.jar

This issue has already been raised as an enhancement request in the Katalon site.

After that, all you need to do is download the Sikuli API JAR file into your Katalon project’s Drivers folder. Sikuli can be found at this location:
https://launchpad.net/sikuli/sikulix/2.0.4/+download/sikulixapi-2.0.4.jar

After that, I just imported the Sikuli classes I needed into our script:

import org.sikuli.script.Key
import org.sikuli.script.Screen
import org.sikuli.script.FindFailed
import org.sikuli.script.ImagePath

Using the ImagePath method you can tell Sikuli where your images are (which I grabbed using Windows Snipping tool):

ImagePath.add(System.getProperty(“user.dir”) + “[\Screenshots\Sikuli](file://Screenshots/Sikuli)”);

And finally a few lines of code (for example)…

Screen s = new Screen()
s.find( “Windows.png” )
s.click( “Windows.png” )

Hope this helps someone!

3 Likes

Great solution. Have been investigating the issue for over 2 months.
For completeness, the error message from the console not able to run Sikuli was
ERROR c.k.katalon.core.main.TestCaseExecutor - Test Cases/Login FAILED.
Reason:
java.lang.NoSuchMethodError: com.sun.jna.Native.load(Ljava/lang/String;Ljava/lang/Class;Ljava/util/Map;)Lcom/sun/jna/Library;

1 Like

Hey how did you fix this error? I tried the fix applied by gengland above and I’m having now the error that you used to have