I am automating UWP using WinAppdriver. Some fields in the application are taking time to initialize. If i try to find to those elements after app launch, they are not available. Used ms:waitForAppLaunch=50 capability of winappdriver to solve the issue, which makes WinAppDriver to wait for a defined amount of time after an app launch is initiated prior to attaching to the application session. I have started WinAppDriver, started the test, passed the capability set, it took 50 secs for the after app launch, to open the UI, where all elements of the app are initialized. Next time, i started the test with the same capability set, but the app launch did not take 50 secs. Same for subsequent running of test without restarting WinAppDriver. Request any help.
WinAppDriver version = WinAppDriver1.2 RC
Below is the capability set
desired_caps['platformName'] = "Windows"
desired_caps['deviceName'] = "WindowsPC"
desired_caps['app'] = "..................!App"
desired_caps["ms:ms:waitForAppLaunch"] = 50
self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)