Katalon TestCloud Jenkins Pipeline Script Example

I could not locate a Katalon TestCloud Jenkins example on the documentation.

Our organization preference is to version control the build configuration in pipeline scripts.
I have only managed to execute tests using a Freestyle project or calling the Freestyle project from another Pipeline job.

It is an issue using parameters and having to call a single Build Job from a series of Freestyle projects from a Pipeline depending on those passed in parameter values.

Is there a Jenkins Pipeline script example of the build process?

1 Like

Yes, there is a Jenkins Pipeline script example for executing Katalon tests with TestCloud environment. You can find it in the documentation (Execute Katalon tests on Jenkins with TestCloud environment | Katalon Docs). Here’s a script template for Windows:

pipeline {  
 agent any  
 stages {  
 stage('Test') {  
 steps {  
 bat """  
 cd <KRE installed folder>  
 katalonc -projectPath="<projectpath>" -browserType="TestCloud" -testcloudEnvironmentId="<string value>" -testcloudTunnel="<true or false>" -retry=<number of retry times> -statusDelay=<seconds> -testSuitePath="<path>" -apiKey="<user API key>" -orgID=<Katalon_OrgID>  
 """  
 }  
 }  
 }  
}

And here’s a script template for macOS/Linux:

pipeline {  
 agent any  
 stages {  
 stage('Test') {  
 steps {  
 sh '''  
 cd <KRE installed folder>  
 ./katalonc -projectPath="<projectpath>" -browserType="TestCloud" -testcloudEnvironmentId="<string value>" -testcloudTunnel="<true or false>" -retry=<number of retry time> -statusDelay=<seconds> -testSuitePath="<path>" -apiKey="<user API key>" -orgID=<Katalon_OrgID>  
 '''  
 }  
 }  
 }  
}

Make sure to replace the placeholders with your actual values, such as the Katalon Runtime Engine (KRE) installed folder, project path, test suite path, TestCloud environment ID, and API key.

Please let me know if this works for you.

@vu.tran I was hoping there was an API request solution that did not rely on installing the Katalon Runtime Engine.
Considering that the main purpose of TestCloud would be directly remote execute tests on a cloud platform rather than accessing a local resource then remotely connecting to TestCloud.

 cd <KRE installed folder> 

Just having to install and maintain another piece of technology in the build process creates another level of instrumentation that could easily be removed if there was a TestCloud API that could be accessed using some form of authentication, e.g. JWT or Bearer Token.

I agree that this is a solution, but it does not seem ideal from a DevOps perspective.

Thank you for your feedback, let me check again with our product team

let me check again with our product team

@vu.tran What was the outcome?

@jason.tolotta Instead of downloading the Katalon Runtime Engine, you just need to input the KRE version then KRE will be downloaded and deployed automatically. The KRE is used to run your test in the cloud environment. In this case, only TestCloud license is required, you don’t need to have an active KRE license.
The second way you can try is Execute a Katalon TestOps plan on Jenkins

1 Like