How do I run Katalon test suite in Jenkins inside Docker

5.8k views Asked by At

I have a Katalon test suite setup and it runs great in the UI and from the CLI on the machine where I have Katalon studio installed.

I have Jenkins CI server running in a docker container, and I would like to setup a job to run my test suite on that Jenkins server.

What runtime do I need on the Jenkins server so it can run a Katalon job? Is there a runtime or a plugin for Jenkins for this?

If not, is there a docker container for Katalon that I can use to remotely run the job via jenkins, like the SonarQube stuff?

6

There are 6 answers

1
mikeb On BEST ANSWER

EDIT - New answer from Katalon support

I got a new response from Katalon support that says:

First of all, I would to sorry for my answer due to I'm not giving out the proper one based on your question. I've reviewed again your question and see Katalon Studio have Linux version (http://download.katalon.com/4.8.0/Katalon_Studio_Linux_64-4.8.tar.gz) for console mode execution and it's ideally to package it into your dockerfile.

That's more like it, and with the documentation here it should be pretty straightforward to get it working with Docker:

https://docs.katalon.com/display/KD/Console+Mode+Execution

Hope this answer resolve your question better :).

END EDIT


ORIGINAL

I created a ticket on the Katalon Studio website asking this same question, and I got this (laughable) response:

First of all, there is no Dockerfile for Katalon Studio. It will be hard and complicated to do this and we also do not have a plan to do it in the future :). But we will try to consider with your request to see if there is any applicable adjustment to this case.

In other words, no Docker solution. It's too bad that we can't use it for our CI stuff, since I had good results with the prototyping I did.

Oh well.

0
Zarashima On

Katalon Studio does have a dedicated version for Linux (http://download.katalon.com/4.8.0/Katalon_Studio_Linux_64-4.8.tar.gz). It utilizes console mode of Katalon Studio and of course you can package it inside your Jenkins container. This approach will adapt with your scenario :).

0
Hana Hasanah On

For now using katalon-execute.sh is deprecated, use katalonc.sh instead. The current documentation is here.

Bonus, my sample Jenkins file with Chrome browser and Windows OS for testing:

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=*****'
                }    
            }
        }
    }
}

Replace the command dir with the direct path to your project folder on the local machine.

0
Giang Dao On

You can find it here and on Docker Hub. But I don't like that it need to be activated by email/password. So it make the build slow down. I intend to make my own docker image including my activated Katalon studio. They seems not support CI really well.

https://github.com/katalon-studio/katalon-studio-docker

1
Mate Mrše On

Since the accepted answer is over two years long, some things have changed and there is now an official Docker image for Katalon at the Docker Hub:

docker pull katalonstudio/katalon

For sample project configuration for various CI tools go here.

Here is a sample Jenkins file:

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'
        }
    }
}
0
mdietrich On

Okay i found it out: use the "sudo docker cp /sourcefolder/Katalon_folder/ ContainerId:/destination_folder"

The same goes for the script. Next step is to install Firefox / geckodriver.