You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何在非本地服务器的Jenkins上执行GitHub存储的Katalon测试套件?

Can You Run Katalon Tests on a Remote Jenkins Server & Pull from GitHub?

Absolutely! You can absolutely run your Katalon test suite on a non-local Jenkins server, and configuring it to pull your test suite directly from GitHub is totally feasible. Let me break down the setup process for you:

Prerequisites First

Before diving in, make sure your remote Jenkins server meets these requirements:

  • Java Runtime Environment (JRE) installed (Katalon depends on Java)
  • If your tests require a GUI (like browser-based tests), you’ll need a virtual display solution (e.g., Xvfb for Linux servers)
  • Either Katalon Studio installed on the server, or use the Katalon Runtime Engine (KRE) (recommended for CI/CD workflows since it’s designed for headless execution)

Step 1: Configure Jenkins to Access Your GitHub Repository

First, you need to give Jenkins permission to pull code from your GitHub repo:

  1. Go to your Jenkins dashboard → Manage Jenkins → Manage Credentials
  2. Add a new credential of type Secret text:
    • Paste your GitHub Personal Access Token (PAT) (make sure it has repo access permissions)
    • Set an ID and description for easy reference (e.g., github-repo-access)
  3. Create a new Jenkins project (Freestyle or Pipeline):
    • For Freestyle: Go to Source Code Management → Select Git → Paste your GitHub repo URL → Choose the credential you just added → Specify the branch you want to pull (e.g., main or master)
    • For Pipeline: Use a git step in your Jenkinsfile to pull the repo with the credential, like this:
      stage('Checkout Code') {
          steps {
              git url: 'https://github.com/your-username/your-katalon-repo.git', 
                  credentialsId: 'github-repo-access', 
                  branch: 'main'
          }
      }
      

Step 2: Set Up Katalon Execution in Jenkins

Next, configure Jenkins to run your Katalon test suite:

KRE is lighter and built for CI/CD. You can run it via Docker (no manual installation needed):
Add a build step (shell script for Linux, batch for Windows) with this command:

docker run -v $(pwd):/katalon/katalon/source katalonstudio/katalon katalon-execute.sh \
    -browserType="Chrome" \
    -retry=0 \
    -statusDelay=15 \
    -testSuitePath="Test Suites/YourTestSuiteName"
  • The -v flag mounts your checked-out repo into the Docker container so Katalon can access the test suite.
  • Adjust browserType and testSuitePath to match your project’s settings.

Option 2: Use Katalon Studio

If you prefer using the full Katalon Studio on the server:

  1. Install Katalon Studio on the remote Jenkins server
  2. Add a build step with this command (adjust paths to match your setup):
katalon -noSplash -runMode=console -consoleLog \
    -projectPath="/var/lib/jenkins/workspace/your-project/your-katalon-project.prj" \
    -testSuitePath="Test Suites/YourTestSuiteName" \
    -browserType="Chrome"

Step 3: Handle GUI Tests on Headless Servers

If your tests use a browser (like Chrome/Firefox), remote Linux servers won’t have a default display. Fix this with Xvfb:

  1. Install the Xvfb Plugin in Jenkins (via Manage Jenkins → Plugins)
  2. In your project configuration, check the box: Start Xvfb before the build, and shut it down after
  3. This creates a virtual display for the browser to run on, so your tests won’t fail due to missing GUI.

Step 4: Verify & Archive Results

After setting up, run a test build to confirm:

  • Jenkins successfully pulls your test suite from GitHub
  • Katalon executes the tests without errors
  • Configure Jenkins to archive test reports (in Freestyle: Post-build Actions → Archive the artifacts; in Pipeline: Use archiveArtifacts step) so you can review results later.

内容的提问来源于stack exchange,提问作者roinrb

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.25 03:28:30