Running Katalon in Headless Mode on Debian with Jenkins

I’m transitioning from Selenium to Katalon and have encountered some challenges while using Jenkins on a Debian system. I execute the following command in headless mode:

./katalon --args -runMode=console -projectPath="/var/lib/jenkins/jobs/katalon_test/workspace/spot-systemtest/src/katalon/spot/katalon test.prj" \
-reportFolder="Reports" -reportFileName="report" \
-retry=0 -testSuitePath="Test Suites/WarmUp" \
-browserType="Headless"

However, during execution, I receive this error:

10-05-2017 06:41:34 AM - [ERROR] - Test Cases/core/login spot2 FAILED because (of) java.awt.HeadlessException: No X11 DISPLAY variable was set, but this program performed an operation which requires it.

When I try setting the DISPLAY variable to ‘:0’, I get the following error instead:

10-05-2017 06:24:49 AM - [ERROR] - Test Cases/core/login spot2 FAILED because (of) java.awt.AWTError: Can't connect to X11 window server using ':0' as the value of the DISPLAY variable.

Since there’s no XServer on this server OS, I attempted to set the environment variable:

export JAVA_OPTS="-Djava.awt.headless=true"

I also tried adding this parameter in the Katalon execution command, but nothing seems to help.

Furthermore, I am experiencing multiple errors, such as “java.lang.NoClassDefFoundError: com.kms.katalon.core.webui.keyword.internal.WebUIAbstractKeyword” during the test execution. The complete stack trace highlights these issues. How can I resolve these headless execution problems with Katalon on a Debian server?

hey! have u tried using XVFB 4 ur headless environment? It can mimic a display and solve that X11 prob. Use xvfb-run in ur jenkins config 2 start Katalon. I did this in a simialer setup, and it worked 4 me. Give it a shot!