Katalon + Github Actions: A new Paradigm of Test Automation

Karthik G
upday devs
Published in
3 min readApr 15, 2021

GitHub Actions is emerging as a widely used CI/CD tool due to its seamless integration capabilities.

Picture courtesy: https://github.blog/

Below are some of the salient features of GitHub Actions:

  1. Build/deploy/test and run code from a Git repo directly
  2. Fully managed service from GitHub ~ we don’t have to worry about scaling infrastructure to run it
  3. Actions fork automatically with the repo

Due to the above features of GitHub actions, framework setup, infra configurations and maintenance efforts for executing automated scripts reduced to a large extent, as we don’t have to use multiple external integrations to connect Git + Jenkins + Katalon anymore. All tests are triggered by a single driver script (docker-compose.yml) directly inside the Git repo.

Below are the pre-requirements and steps to be followed for executing Katalon scripts with Github actions:

Pre-requirements:

  1. Katalon studio enterprise license
  2. Katalon studio version 7.0 and above
  3. API keys

Create an API key:

1. Log into Katalon TestOps with your account (https://analytics.katalon.com/)

2. Click on your profile icon > On the menu tab, select Katalon API Key

3. In the API Key view, click on the ‘create API Key’ button

This API key pulls the test scripts available in the test suite as configured in your Katalon studio.

Katalon studio GitHub action configuration:

Access Katalon studio’s GitHub action from the marketplace (https://github.com/marketplace/actions/katalon-studio)

Action is a .yml file that has to be placed in the .github/workflows folder of your repo.

Example usage:

name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: latest
steps:
- name: Checkout
uses: actions/checkout@v2.2
- name: Katalon Studio Github Action
uses: katalon-studio/katalon-studio-github-action@v2
with:
version: '7.5.5'
projectPath: '${{ github.workspace }}'
args: '-noSplash -retry=0 -testSuiteCollectionPath="Test Suites/Simple Test Suite Collection" -apiKey= ${{ secrets.API_KEY }} --config -webui.autoUpdateDrivers=true'

From the example given above, the build will be triggered whenever there is a push/pull request to the master.

If the build has to be triggered for every ’n’ minutes to enable continuous testing, we can replace the code with the following:

name: CI
on:
schedule:
— cron: “*/n * * * *”

View workflow results and logs:

Navigate to ‘Actions’ tab in your GitHub repo to see the build status of your workflow. Click on the respective build to see logs.

Picture courtesy: https://github.com/katalon-studio-samples/ci-samples

Logging ~ GitHub Actions advantages over other CI tools:

GitHub Actions offers better log viewing and debug experience compared to other CI tools in terms of the following:

  1. Simplified layout structure
  2. Responsive search
  3. Full screen mode and color coded status alerts
  4. Interactive URLs
Picture courtesy: https://github.blog/
Picture courtesy: https://github.blog/

To sum up, we have seen the steps for enabling Katalon scripts execution from GitHub Actions and verifying workflow results in this blog post.

I hope you enjoyed reading this article and you know the drill — clap, comment and share. Cheers, Karthik

--

--

Karthik G
upday devs

Work hard. Have fun. Dream big. Be adventurous.