WindowsDriver NULL: starting WinAppDriver and MSIX App from Code

Hi!

When i start WinAppDriver and the App (installed MSIX package) manually and start the inspector: everything works out correct. Also running tests did work

When I start WinnAppDriver and App from Code:

  • Driver started and listening
  • App started
  • But i cant get the driver-Session, brause it is saied to be NULL.

ANY IDEAS? Could this be because of the app, being installed from an MSIX package?!?

String startWinAppDriver = GlobalVariable.WinAppDriver
ProcessBuilder builder = new ProcessBuilder(startWinAppDriver).inheritIO()
Process startWinAppDriverProcess = builder.start()


String aumid = "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App"
String appArguments = "shell:appsFolder\\$aumid"
String[] cmd = ["explorer.exe", appArguments]
Process process = new ProcessBuilder(cmd).start()


WindowsDriver driver = WindowsDriverFactory.getWindowsDriver()
driver.manage().window().maximize()

Test Cases/_Sandbox/StartApp/Calc FAILED.
Reason:
java.lang.NullPointerException: Cannot invoke "com.kms.katalon.core.windows.driver.WindowsSession.getRunningDriver()" 
because "com.kms.katalon.core.windows.driver.WindowsDriverFactory.windowsSession" is null

1 Like

Hi,

Thank you for letting us know your problems. I think the error relates to Windows drivers and the required library. Can you please take a look at this setup Set up WinAppDriver in Katalon Studio | Katalon Docs to make sure WinAppDriver is good? Also, try WindowsDriverFactory.createWindowsSession() to create the session so that you will not receive NULL

Hi and thank you for your quick answer.
WinAppDriver seems to be running correctly.
Iā€™m afraid, the function .createWindowsSession() is not available ā†’ WindowsDriverFactory (Katalon Studio API Specification).
Iā€™m working with the free version at the moment. Would PRO make a difference here?