Run Sikuli via Katalon

I’m trying to run a test that contains Sikuli methods in it via Katalon-Studio. I added the necessary libraries but still getting this error when it tries to execute the Sikuli command:

[error] ResourceLoaderBasic: checkLibsDir: libs dir is not on system path: C:\Users\roinr\git\QA\Drivers\libs

[action] ResourceLoaderBasic: checkLibsDir: Please wait! Trying to add it to user's path

[info] runcmd: reg QUERY HKCU

[info] runcmd: reg QUERY HKEY_CURRENT_USER\Environment /v PATH

[error] ResourceLoaderBasic: checkLibsDir: Logout and Login again! (Since libs folder is in user's path, but not activated)

[error] Terminating SikuliX after a fatal error! Sorry, but it makes no sense to continue! If you do not have any idea about the error cause or solution, run again with a Debug level of 3. You might paste the output to the Q&A board.

This is my script:

import internal.GlobalVariable as GlobalVariable
import java.io.IOException;
import java.util.concurrent.TimeUnit;
import org.openqa.selenium.By;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.sikuli.script.Key;
import org.sikuli.script.Screen;

//Initializing server
System.setProperty("webdriver.chrome.driver", "C:/selenium/chromedriver.exe");
//Initializing variables
ChromeDriver wd = new ChromeDriver();
WebDriverWait wait = new WebDriverWait(wd,10);
Screen s = new Screen();


wd.manage().window().maximize();
wd.manage().timeouts().implicitlyWait(20, TimeUnit.SECONDS);
System.out.println("*** Login Sikuli ***");
wd.get("https://autoqa-materials-zone.firebaseapp.com/login");
wait.until(ExpectedConditions.visibilityOfElementLocated(By.xpath("//div[2]/div/input")));
wd.findElement(By.xpath("//div[2]/div/input")).click();
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
s.paste("<USERNAME>");
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
s.type(Key.TAB);
try { Thread.sleep(800l); } catch (Exception e) { throw new RuntimeException(e); }
s.paste("<PASSWORD>");
try { Thread.sleep(1000l); } catch (Exception e) { throw new RuntimeException(e); }
wd.findElement(By.xpath("//form[@id='form']//paper-button[.='login']")).click();
try { Thread.sleep(5000l); } catch (Exception e) { throw new RuntimeException(e); }
wd.quit();

Hope you can help me with that,

thanks.

Roi,

Firstly, could you double check to ensure that libs were added correctly? Here is the instruction of doing the task https://docs.katalon.com/display/KD/External+Libraries
Secondly, your script looks a little bit weird. Is it generated from Katalon Studio scripting mode or at the Custom Keyword mode?

I added the jar files (sikuli-script, sikulixapi) as mentioned in the link.
I created this script initially in Eclipse where I used to run my script from.
I just copied my script to Katalon-Studio in script mode

Can you send me your project? Which jar file have you added from Sikuli and how do you obtain it?

I’m sorry but I prefer not to share the project because it is a company project.
As I mentioned, I included the jar files in the same way as this link explains https://docs.katalon.com/display/KD/External+Libraries .
There are two jar files “sikuli-script” and “sikulixapi”.
The “sikulixapi” jar file was created when I first installed sikuli and I think it is necessary for integrating sikuli commands into a java code.
It means that I don’t write the sikuli commands in Python like the traditional way.
I have attached a pic from sikuli installation guide that explains it (Pack 2).

Good news…I just removed the ‘sikulixapi’ jar file from the external libraries list and added it again and it worked. Probably the lib folder needed some kind of a reset.
Thank you all.

2 Likes