Running Katalon in Jenkins slave: how to use github source?


I have an architecture Jenkins master - slave where the Katalon tests are executed in the slave, but the Jenkins is in the master.

I use the typical command line in the build step “execute windows batch”:

cd “C:\Katalon_Studio_Windows_64-6.2.1”
katalon -noSplash -runMode=console -projectPath=“C:\workspaces\Katalon Studio\MyProject\MyProject.prj” -retry=0 -testSuitePath=“Test Suites/create_client” -executionProfile=“default” -browserType=“IE”

I was wondering if it was possible to take the projectPath from my GitHub repository, not from the slave server.

Any help is welcome.

yes, it is possible. use jenkins environment variables to point to the right $WORKSPACE

1 Like

Hi Ibus,

Thanks for the answer. In my case, if the GitHub repository is http://myGitHubUrl./myGitHubRepository.git,

How would I fit that in the command lines?:

cd “C:\Katalon_Studio_Windows_64-6.2.1”
katalon -noSplash -runMode=console -projectPath=“C:\workspaces\Katalon Studio\MyProject\MyProject.prj” -retry=0 -testSuitePath=“Test Suites/create_client” -executionProfile=“default” -browserType=“IE”

Thanks in advance.

you don’t fit it in the command. the git part you have to set it at the source control part. that will be executed before the build task. no matter if is executed on master or slave. once the project is pulled,you have to refer to it in the script by jenkins variables, not by full path. it will be relative to the $WORKSPACE

hint: just make a simple job, set the git part, add a task to run a script where you just list the current directory content

everytime a jenkins build is started,the workspace is created on the fly,so the root path will always change. this is why in the execution script you have to use the environment variables provided by jenkins


@ibus What’s it going to take for me to get you to write a series of integrations TIPS? That stuff is pure gold for some people! :clap:

Write them up as tips articles and we’ll pin them as links in the Integrations category, too.

[quote=“Russ_Thomas, post:5, topic:32128”]
What’s it going to take for me to get you to write a series of integrations TIPS?

from your side nothing…from my side … time. and more time

le: now seriously, digging into jenkins is easy. just hit the ‘show environment variables’ link displayed here and there. with bambooo, oook. here is a different story, but same philosophy

1 Like

Thanks Ibus,

As my job is running in a slave machine, this is what I did:

  1. In the general tab of the Jenkins job, check the GitHub option, then give the git url https://myGitHubUrl./myGitHubRepository.git

  2. In the slave, disable checking the certificates, so I wouldn’t get error for unkown certificates. This I did it by opening a git bash and executing the commands:

a. git init
b. git config --global http.sslVerify false

  1. in the execute Windows batch build step, in the Jenkins job,

//go to the git folder where the katalon project is located
cd “C:\DEV\git\myRepository”

//pull the project, so you have the last version of the source
git pull

//go to the folder where the katalon studio is stored
cd “C:\Katalon_Studio_Windows_64-6.2.1”

//execute the test suite
katalon -noSplash -runMode=console -projectPath=“C:\git\myRepository\MyProject.prj” -retry=0 -testSuitePath=“Test Suites/create_client” -executionProfile=“default” -browserType=“IE”

This seems to work well.

this is a bit redundant. since you already configured the git repo … it is already pulled :slight_smile: i wil try to find some time tomorrow to post my aproach by using only already configured git and jenkins variables. may not be accurate since mostly i used linux slaves but you may figure it out