# Wait for Windows app to load

**URL:** <https://forum.katalon.com/t/wait-for-windows-app-to-load/41244>\
**Category:** Desktop Testing\
**Tags:** desktop, windows, katalon-studio\
**Created:** [March 19, 2020, 6:57am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244 "2020-03-19T06:57:21Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![piotr.kochanek.2](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/piotr.kochanek.2/32/16104_2.png) [@piotr.kochanek.2](https://forum.katalon.com/u/piotr.kochanek.2)\
**Post date:** [March 19, 2020, 6:57am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/1 "2020-03-19T06:57:21Z")

</div>

Hello  
My problem is, that the windows application is starting for like 6-10 sec. The test fails 1/2 times at the beginning of execution. The implicitlyWait doesnt wait for the app. Is there a possibility to wait longer for the application to load?

Current code:

> Runtime.getRuntime().exec("cmd.exe /c start " + “WinAppDriver/WinAppDriver.exe”)  
> Windows.startApplication(GlobalVariable.path)  
> Windows.getDriver().manage().timeouts().implicitlyWait(30, TimeUnit.SECONDS);  
> Windows.setText(findWindowsObject(‘Object Repository/mainWindow/loginWindow/tbUser’), (GlobalVariable.user))  
> Windows.setText(findWindowsObject(‘Object Repository/mainWindow/loginWindow/tbPassword’), (GlobalVariable.password))

Log:

> Caused by: org.openqa.selenium.WebDriverException: Failed to locate opened application window with appId: C:\MyFolder\myApp.exe, and processId: 19468 (WARNING: The server did not provide any stacktrace information)  
> Command duration or timeout: 9.64 seconds  
> Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’  
> System info: host: ‘APS00076262-MB’, ip: ‘172.30.240.1’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0\_181’  
> Driver info: driver.version: WindowsDriver  
> at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)  
> at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)  
> at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$errorHandler$0(JsonWireProtocolResponse.java:54)  
> at org.openqa.selenium.remote.HandshakeResponse.lambda$getResponseFunction$0(HandshakeResponse.java:30)  
> at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(ProtocolHandshake.java:126)  
> at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:128)  
> … 42 more  
> )  
> 2020-03-19 07:52:27.100 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - ❌ 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: C:\MyFolder\myApp.exe, and processId: 19468 (WARNING: The server did not provide any stacktrace information)  
> Command duration or timeout: 9.64 seconds

---

<div class="post-metadata">

**Author:** ![thongnmtran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thongnmtran/32/9806_2.png) [@thongnmtran](https://forum.katalon.com/u/thongnmtran)\
**Post date:** [March 19, 2020, 7:02am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/2 "2020-03-19T07:02:21Z")

</div>



---

<div class="post-metadata">

**Author:** ![thongnmtran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thongnmtran/32/9806_2.png) [@thongnmtran](https://forum.katalon.com/u/thongnmtran)\
**Post date:** [March 19, 2020, 8:01am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/3 "2020-03-19T08:01:10Z")

</div>

Hi @piotr.kochanek.2,

On Oct 10, 2019, Microsoft team had published a **`pre-release`** version ([WinAppDriver v1.2](https://github.com/microsoft/WinAppDriver/releases/tag/v1.2-RC)) which includes a new capability [**ms:waitForAppLaunch**](https://github.com/microsoft/WinAppDriver/releases/tag/v1.2-RC). With this capability, you will able to wait longer for your app to open.

In addition, you will also need to install Appium version [1.16.0 or later](https://github.com/appium/appium/releases) for supporting [WinAppDriver 1.2](https://github.com/microsoft/WinAppDriver/releases/tag/v1.2-RC).

To use **ms:waitForAppLaunch** capability in Katalon, you could go to `Project Settings` and add it to the `Desired Capabilities` section.

 ![image](https://europe1.discourse-cdn.com/katalon/original/2X/4/4db97f8ae18b583e93825c93e3259d9dcdde5770.png)

> Note: “The limit for this is **50** seconds”. So, don’t set it so long /=).

~ Hope this could help! /=)

---

<div class="post-metadata">

**Author:** ![piotr.kochanek.2](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/piotr.kochanek.2/32/16104_2.png) [@piotr.kochanek.2](https://forum.katalon.com/u/piotr.kochanek.2)\
**Post date:** [March 20, 2020, 6:49am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/4 "2020-03-20T06:49:47Z")

</div>

Yep, it’s working for me. Thanks a lot!

---

<div class="post-metadata">

**Author:** ![thongnmtran](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/thongnmtran/32/9806_2.png) [@thongnmtran](https://forum.katalon.com/u/thongnmtran)\
**Post date:** [April 2, 2020, 2:15am UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/5 "2020-04-02T02:15:14Z")

</div>



---

<div class="post-metadata">

**Author:** ![joel.hurtado](https://dub1.discourse-cdn.com/katalon/user_avatar/forum.katalon.com/joel.hurtado/32/16103_2.png) [@joel.hurtado](https://forum.katalon.com/u/joel.hurtado)\
**Post date:** [April 8, 2021, 5:14pm UTC](https://forum.katalon.com/t/wait-for-windows-app-to-load/41244/6 "2021-04-08T17:14:30Z")

</div>

Hello, excuse me, how did you setup appium to support WinAppDriver?, I have appium installed and initiated in different server name to not have issues with WinAppDriver server listener but somehow when I run the katalon recorder the time set with “ms:waitForAppLaunch” property is not taken and still got time out lower than the property set “25”
