Windows testing: how to init a custom WindowsDriver then switch to "Windows" native functions?

Hi,

I need to create a custom WindowsDriver to test a Windows application:

I’m able to start my executable but when I try to use the Katalon native “Windows” functions (like the sendKeys one), I get the following exception:

com.kms.katalon.core.exception.StepFailedException:  (Root cause: java.lang.NullPointerException
	at com.kms.katalon.core.windows.driver.WindowsDriverFactory.getWindowsDriver(WindowsDriverFactory.java:62)

How can I use my custom WindowsDriver with the native “Windows” functions?

Thanks in advance for your help :slight_smile:

after digging through files and documentation, you probably want to have a look at the static methods on WindowsDriver in katalon(import com.kms.katalon.core.windows.driver.WindowsDriverFactory) and then use startApplication(URL remoteAddressURL, String appFile,
DesiredCapabilities initCapabilities, ProxyInformation proxyInfo, String appTitle) to create the driver as you need it, which would then let you use the methods
i’m not sure, but from the quick look i had it seemed that ProxyInformation could be null, and if not, you can check the other methods on WindowsDriverFactory to see how it creates said ProxyInformation

1 Like

Thanks a lot, this is working! :grin:

Here’s the code I used:

WindowsDriverFactory wdf = new WindowsDriverFactory()
wdf.startApplication(new URL(('http://x.x.x.x:4723'), 'D:\xxx\xxx.exe', caps, null, "")