Katalon - Desktop Application testing with Winium driver and katalon keywords?

Im trying to execute the Desktop application testing with Winium driver with an appArgument, I can record the Windows objects through a recorder on the Katalon Keyword.

  • But I didn’t know how to integrate Katalon Windows keywords with the Winium driver to execute the Test

  • Also, I couldn’t pass appArgugument at the runtime of the test execution

  1. EXCEPTION - Winium driver execution script with Katalon keyword

1 Like

Hi there,

Thank you very much for your topic. Please note that it may take a little while before a member of our community or from Katalon team responds to you.

Thanks!

Hi @SJYogesh ,

Can you please share the full error log?

Of course, I will provide a testScript and error log below…

Note:: Im executing a script and .exe from the Winium desktop driver and I tried to use Katalon build-in keywords


Test Script

import static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject

import org.openqa.selenium.winium.DesktopOptions
import org.openqa.selenium.winium.WiniumDriver as WiniumDriver

import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows

driver = null
String appPath = ‘E:\MHS\TestMHS.exe’
DesktopOptions option = new DesktopOptions()
option.setApplicationPath(appPath)
option.setDebugConnectToRunningApp(false)
option.setLaunchDelay(2)
driver = new WiniumDriver(new URL(‘http://localhost:9999’), option)
Thread.sleep(1000)

Windows.click(findWindowsObject(‘Object Repository/testObject/btn_GetArgument’))

Windows.click(findWindowsObject(‘Object Repository/testObject/btn_Ok’))

Windows.click(findWindowsObject(‘Object Repository/testObject/btn_close’))


Error Log

=============== ROOT CAUSE =====================

05-30-2024 09:48:43 AM click(findWindowsObject(“Object Repository/testObject/btn_GetArgument”))

Elapsed time: 0.274s

(Root cause: java.lang.NullPointerException
at com.kms.katalon.core.windows.driver.WindowsDriverFactory.getWindowsDriver(WindowsDriverFactory.java:62)
at com.kms.katalon.core.windows.driver.WindowsDriverFactory$getWindowsDriver.call(Unknown Source)
at com.kms.katalon.core.windows.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:38)
at com.kms.katalon.core.windows.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy)
at com.kms.katalon.core.keyword.internal.KeywordMain.runKeyword(KeywordMain.groovy:90)
at com.kms.katalon.core.keyword.internal.KeywordMain$runKeyword.call(Unknown Source)
at com.kms.katalon.core.windows.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:37)
at com.kms.katalon.core.windows.keyword.builtin.ClickKeyword$click.callCurrent(Unknown Source)
at com.kms.katalon.core.windows.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:33)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
at com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords.click(WindowsBuiltinKeywords.java:72)
at com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords$click.call(Unknown Source)
at Tc_TestCase.run(Tc_TestCase:19)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:448)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:439)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:418)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:410)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:285)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:144)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:135)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1717042717818.run(TempTestCase1717042717818.groovy:25)
)


Hi,

Do you test clicking btn_GetArgument manually?

Yes I can, it clicks

Dear information, please note the report below

I have executed the Winium driver but couldn’t use Windows build keywords for the Desktop Application Testing

  • I started desktop application Testing only with Winium driver, without executing the WinAppDriver I wasn’t able to use Katalon Buildin keywords for desktop application testing
  • I want to use the Katalon build keyword with the Winium driver and without WinAppDriver

I don’t understand what you want just above, but the “NullPointerException” could be from the object you are trying to work with not existing in your Object Repository at the pathway you have. Do you use “drag and drop” for your scripting?

yes grylion54, The object exists and pointing to the correct Object Folder location

I will explain that we avoiding winAppDriver for desktop Application Testing due to the client machine security policy, so I started desktop application testing with the WiniumAppDriver,

I started scripting and was suddenly shocked, I couldn’t use the Katalon build-in keyword when I started with the Winium driver, but once I tried to execute the same script with WinAppDriver it worked fine.

So can anyone suggest solving the issue?

Same script working in WinAppDriver

Hello Guys, I got a correct response from the Katalon team.

All, Thanks for your responses