How to use Katalon plugin for Jenkins on Ubuntu

This tutorial will walk you through basic steps to run Katalon Studio’s web UI tests using our plugin for Jenkins on a headless Ubuntu machine i.e. a machine without any display.

If you are interested in using Docker images instead, please see GitHub - katalon-studio-samples/ci-samples: Sample configurations for various CI systems..

If you are using Windows or macOS we will have similar tutorials soon.

Install Jenkins

Please follow official instructions by Jenkins.

Install Google Chrome

wget -O google-chrome-stable_current_amd64.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt -y -f install

Install Xvfb

From Wikipedia:

Xvfb or X virtual framebuffer is a display server implementing the X11 display server protocol. In contrast to other display servers, Xvfb performs all graphical operations in virtual memory without showing any screen output. From the point of view of the client, it acts exactly like any other X display server, serving requests and sending events and errors as appropriate. However, no output is shown. This virtual server does not require the computer it is running on to have any kind of graphics adapter, a screen or any input device. Only a network layer is necessary.

sudo apt install -y xvfb

Install Katalon plugin for Jenkins

Go to Manage Jenkins > Manage Plugins > Available and find Katalon plugin on the list.

Create and configure a new Jenkins project

To keep it simple, I will use Freestyle project.

The sample Katalon Studio project can be cloned from Github.

Next, add and configure the build step Execute Katalon Studio tests provided by Katalon plugin for Jenkins.

  • Katalon Studio will be downloaded and installed automatically based on the version you specify.
  • Please leave out -runMode in the arguments list.
  • If you want to learn more about xvfb-run configuration please see its manual. If you are not sure, only change the resolution 1024x768x24 and leave other options as-is.

If for some network conditions the Katalon Studio package cannot be downloaded, you can install it manually and specify its location.

me@ubuntu:~$ sudo su
root@ubuntu:~$ su jenkins
jenkins@ubuntu:~$ wget https://github.com/katalon-studio/katalon-studio/releases/download/v5.10.1/Katalon_Studio_Linux_64-5.10.1.tar.gz
jenkins@ubuntu:~$ tar -xzf Katalon_Studio_Linux_64-5.10.1.tar.gz
jenkins@ubuntu:~$ cd Katalon_Studio_Linux_64-5.10.1 && pwd

The last command will print the location you need (/var/lib/jenkins/Katalon_Studio_Linux_64-5.10.1).

Run, Katalon, run!

Go to the Jenkins project page (e.g. at http://localhost:8060/jenkins/job/test/ if its name is “test”), click Build Now.

After it finished, you can find the report in the Last Successful Artifacts section.

Advantages

  • It’s quick and easy - you won’t even have to install Katalon Studio manually
  • It works even on machines without displays.
  • Allocating an isolated virtual display for each Jenkins build increases the stability of execution.
4 Likes

If you are using Windows or macOS we will have similar tutorials soon.

——When will you offer the macOS tutorials?
follow the old tutorial(https://docs.katalon.com/katalon-studio/docs/jenkins-integration.html), I run Katalon testsuits/testcollection by jenkins on macOS , and come across a lot of problems.

3 Likes

Thanks for the guide - I’m seeing an error related to Chrome not properly starting when trying to call openBrowser("") as follows:

21:15:47 2019-02-06 21:15:47.406 DEBUG testcase.Root user login                 - 1: System.setProperty("webdriver.chrome.driver", "/usr/bin/google-chrome")
21:15:47 2019-02-06 21:15:47.409 DEBUG testcase.Root user login                 - 2: openBrowser("")
21:15:48 2019-02-06 21:15:48.203 INFO  c.k.k.core.webui.driver.DriverFactory    - Starting 'Chrome' driver
21:15:48 2019-02-06 21:15:48.256 INFO  c.k.k.core.webui.driver.DriverFactory    - Action delay is set to 0 seconds
21:15:49 Starting ChromeDriver 2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d) on port 9914
21:15:49 Only local connections are allowed.
21:15:50 2019-02-06 21:15:50.158 ERROR c.k.k.core.keyword.internal.KeywordMain  - ❌ Unable to open browser with url: '' (Root cause: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
21:15:50   (unknown error: DevToolsActivePort file doesn't exist)
21:15:50   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
21:15:50   (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.111+ x86_64) (WARNING: The server did not provide any stacktrace information)
21:15:50 Command duration or timeout: 417 milliseconds
21:15:50 Build info: version: '3.7.1', revision: '8a0099a', time: '2017-11-06T21:07:36.161Z'
21:15:50 System info: host: '<host>', ip: '<IP>', os.name: 'Linux', os.arch: 'amd64', os.version: '4.4.111+', java.version: '1.8.0_181'
21:15:50 Driver info: driver.version: CChromeDriver)
21:15:50 2019-02-06 21:15:50.166 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ openBrowser("") FAILED.
21:15:50 Reason:
21:15:50 com.kms.katalon.core.exception.StepFailedException: Unable to open browser with url: '' (Root cause: org.openqa.selenium.WebDriverException: unknown error: Chrome failed to start: exited abnormally
21:15:50   (unknown error: DevToolsActivePort file doesn't exist)
21:15:50   (The process started from chrome location /usr/bin/google-chrome is no longer running, so ChromeDriver is assuming that Chrome has crashed.)
21:15:50   (Driver info: chromedriver=2.43.600233 (523efee95e3d68b8719b3a1c83051aa63aa6b10d),platform=Linux 4.4.111+ x86_64) (WARNING: The server did not provide any stacktrace information)
21:15:50 Command duration or timeout: 417 milliseconds

Any idea why this could be happening?

@devalex88 Waiting for the Windows tutorial :slight_smile:

Is your Chome installed in this location: /usr/bin/google-chrome? Please double check once again this location.

Is there any update on windows tutorial?

Please share the windows tutorial …

@Zarashima Great Plugin.

But it would like to know how can we parameterize the “Command Arguments” field.

Like for example if below is the command:-

-retry=0 -testSuitePath=“Test Suites/H1” -executionProfile=“live” -browserType=“Chrome”

Now how can I parameterize the >-executionProfile="live" to something like >-executionProfile="${env}"

and the value will be coming from Jenkins build parameters

I pull a project from Git to run test on Jenkins using Katalon plugin. On the console output, it says

Opening project file: /home/admin/workspace/Katalon_Test_Automation
Invalid argument: Cannot find project ‘/home/admin/workspace/Katalon_Test_Automation’.
Build step ‘Execute Katalon Studio Tests’ marked build as failure
Notifying upstream projects of job completion
Finished: FAILURE

But when I check, the directory ‘/home/admin/workspace/Katalon_Test_Automation’ does exist (I can cd to it). Could you help me solve this please?

Hi, I’m getting the exact same error.
I can confirm that google-chrome is installed to /usr/bin/google-chrome

Update (after a tiny bit of research):
the google chrome error is caused by
(unknown error: DevToolsActivePort file doesn’t exist)
which is a xvfb error

The command argument I used was
-a -n 0 -s “-screen 0 1024x768x24”

Still not sure how to fix it though?

1 Like


@devalex88 Test Suites execution is successful, but a build failure is indicated.

Please help me

Hi @roy.zheng… I got same problem. Did you find the solution for that :thinking:

-a -n 0 -s "-screen 0 1024x768x24"

This has to be accurate, I just got one of the characters wrong. @rushantha

1 Like

I already put as it is.

Can I see your error message?

This is the error log :- error log.txt (16.3 KB)

In windows machine it executes properly without any error. in the ubuntu machine giving this kind of error. but recorded video shows test case executes properly

Unable to click on object 'Object Repository/Homepage/SignIn_Option'

Error message in log, you need to fix it. If it works in Windows, but it doesn’t work in ubuntu, you need to check if there is a browser compatibility problem

But recorded video showing test cases executing properly… and there is no issue with browser compatibility .i checked it manually

Are you checking manually in ubuntu?

yes @roy.zheng