Cannot launch some tests for my UWP App. Error "Failed to locate opened application window with appId:"
See original GitHub issueI have UWP app with loading page to start app (no splash). Some tests (not all), fail with this message “Failed to locate opened application window with appId:”. I tried several thing (update appium client to lastest version(7.4.1), put a ms:waitForAppLaunch capability and createSessionTimeout) and it’s not work.
This is my code in Java (my tests are in Junit):
public void setUp() throws Exception { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "AppPackage!App"); windows = new WindowsDriver(new URL("http://127.0.0.1:4723"), capabilities); capabilities.setCapability("createSessionTimeout",600000); capabilities.setCapability("ms:waitForAppLaunch",50); windows.manage().timeouts().implicitlyWait(60, TimeUnit.SECONDS); Thread.sleep(120000); }
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (1 by maintainers)
Top GitHub Comments
Please use inspect.exe to see the class of the loading page. WinAppDriver expects ApplicationFrameWindow or Windows.UI.Core.CoreWindow. If it’s not this window, likely you are not in the supported path.
There is no good workaround for this until an code change in WinAppDriver.
I didn’t do the testing, but a possible workaround is execution alias. which will fool the WinAppDriver to make it think it’s not an UWP app and launch it as a legacy application. Of course, there are still some rule in the legacy path. Your app may or may not launchable from WinAppDriver with ExecutionAlias.
If your app didn’t kill by WinAppDriver automatically when it failed, It’s possible to continue the testing. You can open another session with
Then do the testing in ‘desktop’. Of course, ‘root’ includes all process, so you need to filter other processes by yourself.
Thanks, but it cannot fix my problem. Because, I need a timeout from WinAppDriver. No catch a windows.