Running Katalon Test Suites in Jenkins Inside Docker

Running Katalon Test Suites in Jenkins Inside Docker

26 February 2025 Stephan Petzl Leave a comment Katalon Issues

Integrating Katalon Studio with Jenkins in a Docker environment can streamline your continuous integration (CI) process. This guide provides a step-by-step approach to setting up your Katalon test suite to run efficiently on a Jenkins server hosted within a Docker container.

Setting Up Katalon Studio for Docker

Katalon Studio offers a Linux version suitable for console mode execution, which can be packaged into a Docker container. This method allows you to run your Katalon test suites seamlessly in a Jenkins CI environment.

To get started, download the Katalon Studio Linux version from the official source and include it in your Dockerfile. This setup enables you to execute tests in the console mode, which is ideal for CI/CD pipelines.

Using the Official Katalon Docker Image

As of recent updates, there is an official Docker image available for Katalon Studio. This image simplifies the integration process by eliminating the need for manual environment configuration.

docker pull katalonstudio/katalon

Incorporate this image into your Jenkins pipeline by configuring your Jenkinsfile to use the Docker container. Below is a sample Jenkinsfile configuration:

pipeline {
    agent {
        docker {
            image 'katalonstudio/katalon'
            args "-u root"
        }
    }
    stages {
        stage('Test') {
            steps {
                sh 'katalon-execute.sh -browserType="Chrome" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/TS_RegressionTest"'
            }
        }
    }
    post {
        always {
            archiveArtifacts artifacts: 'report/**/*.*', fingerprint: true
            junit 'report/**/JUnit_Report.xml'
        }
    }
}

Updating to the Latest Execution Script

It’s important to note that the previously used katalon-execute.sh script is now deprecated. The recommended script for executing tests is katalonc.sh. Ensure your Jenkins file reflects this change to maintain compatibility with the latest Katalon updates.

pipeline {
    agent any
    stages {
        stage('Test') {
            steps {
                dir('/SOURCE/integrate-jenkins-with-kdi') {
                    bat 'docker run -t --rm -v "%cd%":/tmp/project katalonstudio/katalon katalonc.sh -projectPath=/tmp/project -browserType="Chrome" -retry=0 -statusDelay=15 -testSuitePath="Test Suites/TS_example" -apiKey=*****'
                }    
            }
        }
    }
}

Enhancing Test Automation with Repeato

While Katalon Studio provides robust solutions for test automation, you might encounter limitations with scripting languages and open-source flexibility. Here, Repeato offers a compelling alternative. As a no-code test automation tool, Repeato is designed for iOS, Android, and web apps, employing computer vision and AI to streamline test creation and maintenance.

Repeato’s ability to run command line scripts or JavaScript code makes it versatile for automating complex tasks. Its support for data-driven and keyword-driven testing further enhances its utility in diverse testing scenarios. With all tests and workspace data stored in text and JSON formats, version control becomes straightforward, offering an advantage over traditional tools like Katalon.

Explore how Repeato can integrate into your CI/CD pipeline by visiting our documentation.

Like this article? there’s more where that came from!