suddently i am getting this error when i’ll try to execute Jenkins job
org.codehaus.groovy.runtime.InvokerInvocationException: java.awt.AWTError: Can’t connect to X11 window server using ‘:1’ as the value of the DISPLAY variable. %
I have used in Jenkins
#!/bin/bash
export DISPLAY=:1
cd /home/xxxx
/var/Katalon_Studio_Linux_64-5.8.6/katalon -noSplash -runMode=console -projectPath="$WORKSPACE/katalon-project.prj" -retry=0 -testSuitePath=“Test Suites/NightlyTestSuite” -executionProfile=“default” -browserType=“Chrome (headless)” -reportFolder="$WORKSPACE/Reports" -apiKey=cc8af8de-a3d9-4dee-8e42-ac8753ae4b6d
set +e
and X is running
[root@testframe-ng ~]# pidof X && echo “yup X server is running”
1435
yup X server is running
both plugins run in my server
tcp 0 0 0.0.0.0:6001 0.0.0.0:* LISTEN 2894/Xvnc
tcp 0 0 0.0.0.0:6099 0.0.0.0:* LISTEN 1359/Xvfb
@Timo_Kuisma2 now we know. the ‘:number’ should match with the DISPLAY variable. the ‘screen’ i think is related to virtual desktop.
make a note of it, some other users may have same issue
if during a day we learn nothing, that day is lost
in your Jenkins script use this as display number
like
export DISPLAY=:99
reference doc: https://linux.die.net/man/1/xvfb
you can control how the xfvb is started.
how to actually do it, depends if you are using jenkins xfvb plugin, or do you start/pass the options via third-party scripts.
however make note that the $DISPLAY value should match in both, the daemon launching script and in your katalon execution script.