Hello there,
We are supporting a customer to run Windows app automation test with using KRE (Katalon Runtime Engine).
I am putting an issue relates to integration, where is using KRE to run Window application automation test on Jenkins node.
I know the issue could involve many factors include WinAppDriver, Jenkins and KRE. However, I would like to put all details here to discuss further.
Environment:
- WinAppDriver v1.2.1: Release WinAppDriver v1.2.1 · microsoft/WinAppDriver · GitHub
- KRE versions: Windows_x64 - v8.5.5, v8.6.9, v9.7.4 (license installed properly)
- OS: os.name: ‘Windows Server 2019’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_282’
Test can execute fine on
- Katalon Studio Enterprise (KSE).
- Open Remote Desktop to the Jenkins node, open CMD (Run as Administrator), run test with command-line using KRE.
Test cann’t execute when
- Trigger Jenkins job, with sending the same command-line.
Note: It cann’t be executed even loggin in the RDP, keep without lock screen but nothing could be seen.
The command-line that we used as below
C:\software\Katalon_Studio_Engine_Windows_64-8.6.9\Katalon_Studio_Engine_Windows_64-8.6.9\katalonc.exe -noSplash -runMode=console -projectPath=“<path_to_project_dir>\Test0405.prj” -retry=0 -testSuitePath=“Test Suites\TS002” -executionProfile=“Jenkins” -browserType=“Windows” -statusDelay=15 -apiKey=<secrets_here>
The error could be seen
2025-02-21 12:31:27.271 DEBUG testcase.ICOLIMS Login and Launcher - 5: startApplication(ApplicationPath)
2025-02-21 12:31:27.370 INFO c.k.k.c.w.driver.WindowsDriverFactory - Starting application D:\App\myApp.exe on the local machine at address http://127.0.0.1:4723
2025-02-21 12:31:27.375 INFO c.k.k.c.w.driver.WindowsDriverFactory - desiredCapabilities = {"ms:waitForAppLaunch":"50"}
Windows Application Driver listening for requests at: http://127.0.0.1:4723/
Press ENTER to exit.
==========================================
POST /session HTTP/1.1
Accept-Encoding: gzip
Connection: Keep-Alive
Content-Length: 332
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4723
User-Agent: selenium/3.141.59 (java windows)
{
"desiredCapabilities": {
"app": "D:\\App\\myApp.exe",
"ms:waitForAppLaunch": "50",
"platformName": "Windows"
},
"capabilities": {
"firstMatch": [
{
"appium:app": "D:\\App\\myApp.exe",
"ms:waitForAppLaunch": "50",
"platformName": "windows"
}
]
}
}
--------------------------------------------------------------------------------
Test Suites/xxx_TS002 - Windows - 20250221_123124..0/1(0%)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Test Suites/xxx_TS002 - Windows - 20250221_123124..0/1(0%)
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
Test Suites/xxx_TS002 - Windows - 20250221_123124..0/1(0%)
--------------------------------------------------------------------------------
HTTP/1.1 500 Internal Error
Content-Length: 165
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: D:\\App\\myApp.exe, and processId: 64972"}}
2025-02-21 12:32:23.840 ERROR c.k.k.core.keyword.internal.KeywordMain - ? Unable to create a new remote session. Please check the server log for more details. Original error: Failed to locate opened application window with appId: D:\App\myApp.exe, and processId: 64972 (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 55.96 seconds
Based on the error message, we found few open issues like
- Failed to locate opened application window with appId on Remote Desktop · Issue #1748 · microsoft/WinAppDriver · GitHub
- Failed to locate opened application window with appId · Issue #1737 · microsoft/WinAppDriver · GitHub
- Failed to locate opened application window with appId: C:\Windows\System32\calc.exe
In addition, the Jenkinsfile definition looks like
stages{
stage ('Run Katalon Test') {
steps {
script {
try {
bat """
echo "Clean old report ..."
if exist ${REPORT_PUBLISH_ZIP} rmdir /S /Q ${REPORT_PUBLISH_ZIP}
rmdir /S /Q ${WORKSPACE}\\${KATALON_PACKAGE_NAME}\\${REPORT_FOLDER}
echo "Run Katalon ${CHOICE} test ..."
if "${CHOICE}" == "${isTestSuite}" (
${KATALON_CMD}\\katalonc.exe -noSplash -runMode=console -projectPath="${WORKSPACE}\\${KATALON_PACKAGE_NAME}\\${KATALON_PROJECT_FILENAME}" -retry=0 -testSuitePath="Test Suites\\${TSC_NAME}" -executionProfile="${KATALON_PROFILE}" -browserType="${BROWSER}" -statusDelay=15 --config -webui.autoUpdateDrivers=false
)
)
if "${CHOICE}" == "${isTestSuiteCollection}" (
${KATALON_CMD}\\katalonc.exe -noSplash -runMode=console -projectPath="${WORKSPACE}\\${KATALON_PACKAGE_NAME}\\${KATALON_PROJECT_FILENAME}" -retry=0 -testSuitePath="Test Suites\\${TSC_NAME}" -executionProfile="${KATALON_PROFILE}" -browserType="${BROWSER}" -statusDelay=15 --config -webui.autoUpdateDrivers=false
)
)
set exitCode=%ERRORLEVEL%
echo exitCode=%exitCode%
We are looking forward a solution or guideline to unblock this issue. Or it can be a sample project where it works then we can refer to.
Thank you in advance!