Hi Community members, ![]()
Are you aware that the Microsoft-hosted agents for Ubuntu 18.04 were retired completely from April 2023? In other words, you must update your yml file to Ubuntu 20.04 onwards.
There are some error messages that you may get familiar with when executing the tests with Azure DevOps or Github Action on Ubuntu 20.04 onwards.
ADO Error(Operation Cancelled)Unable to init server: Could not connect: Connection refused" in Github Actions for Ubuntu 20.04Unable to init server: Could not connect: Connection refusedKatalonc: Cannot open display:
To move forward, please refer to the following steps:
- On Ubuntu 20.04 and 22.04, Microsoft set JDK 11 as the default Java version. Thus, this default is incompatible with the Katalon Runtime OS requirement.
| Required Operating System | |
|---|---|
| Default Java Versions should be | Katalon Runtime Engine Versions |
| OpenJDK 8 | Version 8.x |
| OpenJDK 17 | Version 9.x |
So we basically need to change the default Java version on the yml file to 8 for KRE v8, and 17 for KRE v9 onward without manually downloading Java 11.
- In detail, to change the default Java version on your yml file, please refer to the parameters below:
Version 8.x
Azure DevOps
env:
JAVA_HOME: $(JAVA_HOME_8_X64)
PATH: $(JAVA_HOME_8_X64)/bin:$(PATH)
GitHub Actions
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # Set any 'Supported distributions' according to your preferences
java-version: '8'
Version 9.x
Azure DevOps
env:
JAVA_HOME: $(JAVA_HOME_17_X64)
PATH: $(JAVA_HOME_17_X64)/bin:$(PATH)
GitHub Actions
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # Set any 'Supported distributions' according to your preferences
java-version: '17'
References:
Sample yml files to run with KRE v8:
Azure DevOps
trigger:
master
pool:
vmImage: 'ubuntu-20.04'
steps:
task: katalonTask@1
inputs:
version: '8.6.8'
executeArgs: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'
xvfbConfiguration: '-s "-screen 0 1024x768x24"'
env:
JAVA_HOME: $(JAVA_HOME_8_X64)
PATH: $(JAVA_HOME_8_X64)/bin:$(PATH)
GitHub Actions
name: Chris
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # Set any 'Supported distributions' according to your preferences
java-version: '8'
name: Prepare
run: |
sudo apt-get -y install xvfb
sudo /usr/bin/Xvfb :0 -screen 0 1280x1024x24 &
name: Katalon Studio Github Action
uses: katalon-studio/katalon-studio-github-action@v2
with:
version: '8.6.8'
projectPath: '${{ github.workspace }}'
args: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'
Sample yml files to run with KRE v9
Azure DevOps
trigger:
master
pool:
vmImage: 'ubuntu-20.04'
steps:
task: katalonTask@1
inputs:
version: '9.0.0'
executeArgs: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'
xvfbConfiguration: '-s "-screen 0 1024x768x24"'
env:
JAVA_HOME: $(JAVA_HOME_17_X64)
PATH: $(JAVA_HOME_17_X64)/bin:$(PATH)
GitHub Actions
name: Chris
# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the "master" branch
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-java@v3
with:
distribution: 'zulu' # Set any 'Supported distributions' according to your preferences
java-version: '17'
name: Prepare
run: |
sudo apt-get -y install xvfb
sudo /usr/bin/Xvfb :0 -screen 0 1280x1024x24 &
name: Katalon Studio Github Action
uses: katalon-studio/katalon-studio-github-action@v2
with:
version: '9.0.0'
projectPath: '${{ github.workspace }}'
args: '-testSuitePath="Test Suites/New Test Suite" -browserType="Chrome" -apiKey=$(katalon_api_key) --config -webui.autoUpdateDrivers=true'

