DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Please enter at least three characters to search
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

Modernize your data layer. Learn how to design cloud-native database architectures to meet the evolving demands of AI and GenAI workkloads.

Secure your stack and shape the future! Help dev teams across the globe navigate their software supply chain security challenges.

Releasing software shouldn't be stressful or risky. Learn how to leverage progressive delivery techniques to ensure safer deployments.

Avoid machine learning mistakes and boost model performance! Discover key ML patterns, anti-patterns, data strategies, and more.

Related

  • Pipeline as a Service: How To Test Pipelines in GitLab
  • What Is API-First?
  • Testcontainers: From Zero To Hero [Video]
  • Integrating Jenkins With Playwright TypeScript: A Complete Guide

Trending

  • How Large Tech Companies Architect Resilient Systems for Millions of Users
  • The Modern Data Stack Is Overrated — Here’s What Works
  • Unlocking AI Coding Assistants Part 4: Generate Spring Boot Application
  • A Guide to Container Runtimes
  1. DZone
  2. Testing, Deployment, and Maintenance
  3. DevOps and CI/CD
  4. Katalon Continuous Integration With GitLab

Katalon Continuous Integration With GitLab

This tutorial walks through the steps needed to automatically run your Katalon test suites when you push any change on your GitLab repository.

By 
Ahmed Hussein user avatar
Ahmed Hussein
·
Updated Aug. 13, 18 · Tutorial
Likes (3)
Comment
Save
Tweet
Share
10.5K Views

Join the DZone community and get the full member experience.

Join For Free

Introduction

When you make changes to your project source code, you definitely need to run Katalon tests again to make sure that changes are correct. But you may find it boring to run them every now and then, with a possibility to forget to do so. Here, Continuous Integration becomes very important, as it allows you to automate the Change-Then-Test process.

This tutorial walks through the steps needed to automatically run your Katalon test suites when you push any change on your GitLab repository.

Requirements

  • You have a GitLab account and you already put your web app in a Git repository. You can download this sample PHP application to be able to go through.
  • You have a web server hosting your application (e.g. XAMPP Apache Server).
  • You have Katalon Studio installed and you have created a test suite with one or more test cases.
  • This tutorial is limited to Windows, but you may perform similar steps on other platforms.

1. Register and Install GitLab Runner

Download GitLab runner for x86 or amd64, then follow the steps in the following video

Note: In the video, we added the tag “shell” in order to run test cases on the local machine. However, you can add other tags like docker and ssh.

2. Add a Configuration File to Your Repository

In the root directory of your repository, add a file named .gitlab-ci.yml. Open the file and type the following:

run_katalon_test_suite:
      tags:
        - shell
      script:
        - katalon -noSplash  -runMode=console -consoleLog -projectPath=
          "<Your_Project_Directory>" -retry=0
          -testSuitePath="Test Suites/<Test_Suite_Name>" -executionProfile=
          "default" -browserType="Chrome (headless)"

Note: typically, your default project directory is “C:\Users\<USERNAME>\Katalon Studio\<PROJECT_NAME>\<PROJECT_NAME>.prj”

If you want to start your web server automatically before running test cases, add a command at the beginning of the configuration file. For example, to open XAMPP apache server, add this command at the beginning of the file:

before_script:
      - start /B cmd /K "<Path_To_HTTPD_Executable>"

Note: typically, the default httpd.exe file location in XAMPP is “C:\xampp\apache\bin\httpd.exe”

If you want to stop your web server after executing test cases, add a command at the end of your script. For XAMPP Apache Server, the command is taskkill /F /IM httpd.exe . So, the final file should look like this:

before_script:
      - start /B cmd /K "<Path_To_HTTPD_Executable>"

    run_katalon_test_suite:
      tags:
        - shell
      script:
        - katalon -noSplash  -runMode=console -consoleLog -projectPath=
          "<Your_Project_Directory>" -retry=0
          -testSuitePath="Test Suites/<Test_Suite_Name>" -executionProfile=
          "default" -browserType="Chrome (headless)"
        - taskkill /F /IM httpd.exe

3. Add Katalon Path to Environment Variables

  • Go to Control Panel > System and Security > System
  • Click on “Advanced system settings” on the left pane

Image title

  • Choose the “Advanced” tab and click “Environment Variables…”

Image title

  • In “System variables” section, choose the variable “Path” and click “Edit…”

Image title

  • In the “variable value” field, add ";" and then the directory of Katalon Studio

Image title

Note: the first 3 steps are needed only once.

4. Make Changes and Test

After saving some changes, push them to your git repository. After that, open the repository > CI/CD > Pipelines

Image title

  • You can see one of the following marks in your pipeline:

Image title

Now, click on the job link.

Image title

  • See testing results (you may need to wait some time to see results)

Image title

Note: you may see an error like this:

Image title

If you see it, run the command below from your local git repository and try again:

git config --system http.sslverify false

Conclusion

Once you have Katalon test cases prepared, you only need to focus on updating your project. You will no longer need to repeatedly go and run test cases manually after each update because this process is already automated. You are just informed whether your commits are successful or not. However, you can still find detailed testing reports in the Reports folder that is located in your Katalon Studio project root directory. The development and testing processes can be summarized in the following diagram:

Image title

Continuous Integration/Deployment GitLab Testing Integration Web server Katalon Studio

Opinions expressed by DZone contributors are their own.

Related

  • Pipeline as a Service: How To Test Pipelines in GitLab
  • What Is API-First?
  • Testcontainers: From Zero To Hero [Video]
  • Integrating Jenkins With Playwright TypeScript: A Complete Guide

Partner Resources

×

Comments
Oops! Something Went Wrong

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • support@dzone.com

Let's be friends:

Likes
There are no likes...yet! 👀
Be the first to like this post!
It looks like you're not logged in.
Sign in to see who liked this post!