Integrations with Jenkins

When I m trying to execute my katalon project through jenkins i am getting error as katalon cannot open…
Note : katlon project created in windows machine and stored into git.
Execution Machine:
Ubuntu server
please look on it and help me to resolve this issue…

**log **

!ENTRY org.eclipse.osgi 4 0 2018-10-03 03:13:09.865

!MESSAGE Application error

!STACK 1

java.lang.IllegalStateException: The platform metadata area could not be written: /opt/katalon/config/.metadata. By default the platform writes its content

under the current working directory when the platform is launched. Use the -data parameter to

specify a different content area for the platform.

errors.JPG

looks like permission issue for my eyes

does the jenkins user have the rights to write to the “/opt/katalon/config/” folder?

1 Like

Ibus said:

looks like permission issue for my eyes

does the jenkins user have the rights to write to the “/opt/katalon/config/” folder?

i changed permission now i am getting different error. Please do need full

er1.JPG

what exactly you did? now is worse …

if you just simply run katalon from cli, outside of jenkins, it works?

1 Like

Ibus said:

what exactly you did? now is worse …

if you just simply run katalon from cli, outside of jenkins, it works?

Vignesh : Yes, it is working via cli. I just gave the permission for the folders as you said and re-run using a jenkins job it is giving the above error.
Question : Any Steps to run Katalon through Jenkins Job ?

honestly, i am cheating, i never use standalone katalon installed on the jenkins executor, just the docker image.

I use some shell steps like that:

TS_PATH = "Test\\ Suites/Retailers/TS_$TEST_SUITE_NAME"

katalon_opts = "-browserType='Chrome' -retry=0 -statusDelay=15 -consoleLog -testSuitePath=$TS_PATH -executionProfile=$TEST_ENV"

mkdir $REPORT_DIR

docker run --rm --name katalon \
-v $(pwd)/PROJECT_FOLDER:/katalon/katalon/source:ro \
-v $(pwd)/$REPORT_DIR:/katalon/katalon/report \
-e KATALON_OPTS="$katalon_opts" katalonstudio/katalon:5.7.0

the TEST_SUITE_NAME and TEST_ENV vars are passed as job parametters.

the REPORT_DIR one i build it in inject vars plugin with groovy syntax, sort of:

def TODAY = new Date().format(‘YYYY_MM_dd’)
def REPORT_DIR = “${TEST_SUITE_NAME}_${TEST_ENV}_${TODAY}.${BUILD_NUMBER}”

yes i do understand now. but i guess i still dint get answer for my doubt. In CLI its working fine without any issues, here i need to run katalon on jenkins. probably my doubt was about to know is there is any possibility to work in jenkins ?

possible ? not possible ? (share me if you aware of it please )

Thanks in advance and Great to spend time with you .

thanks for your valuable time too.

you have to keep in mind that, whatever you run from jenkins, it is running as ‘jenkins’ user

therefore you have to carefully setup the permissions with your set-up

without solid knowledge on linux permissions, or detailed explanations on what you have changed in there, i am afraid we cannot help too much

see this short guide:

1 Like

i changed permission to the folder,in CLI working fine but when i m trying to run through jenkins i m getting error…I have attached log and jenkins console output error.please go through on it and help me to resolve this issue…

err2.JPG

log.txt

there may be multiple causes for your errors.

first of all i noticed:

-testSuitePath=Test Suites/Catz

-browserType=Chrome (headless)

those two contains spaces, therefore are not resolved properly by the shell.

you have to enclose them in quotes or escape the space, e.g:

-testSuitePath=Test\ Suites/Catz

or

-testSuitePath=“Test Suites/Catz”

also i see an “cannot open display” error. you may have to use the xfvb plugin to solve that issue

https://wiki.jenkins.io/display/JENKINS/Xvfb+Plugin

1 Like

Ibus said:

there may be multiple causes for your errors.

first of all i noticed:

-testSuitePath=Test Suites/Catz

-browserType=Chrome (headless)

those two contains spaces, therefore are not resolved properly by the shell.

you have to enclose them in quotes or escape the space, e.g:

-testSuitePath=Test\ Suites/Catz

or

-testSuitePath=“Test Suites/Catz”

also i see an “cannot open display” error. you may have to use the xfvb plugin to solve that issue

https://wiki.jenkins.io/display/JENKINS/Xvfb+Plugin

Thanks I solved my issue…