Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to locate opened application window with appId"xxx" and process "xxx" #326

Closed
anunayaabb opened this issue Dec 12, 2017 · 6 comments
Labels

Comments

@anunayaabb
Copy link

HI

I am using the latest windows app driver(1.0) to test my company UWP application. When I try to execute my tests I continuously get the above error (mentioned in the subject line).

I tried the workaround wherein I create a desktop session and switch to the desktop window. But still I get the same error, it already been a day I am trying to debug the issue.

The windows 10 version that I am using is 16299.

Please help.

@anunayaabb
Copy link
Author

Appium dotnet driver version is 3.0.0.2

@timotiusmargo
Copy link
Contributor

Hi @anunayaabb,

The first things you would need to identify are:

  1. The right main application window that you are targeting. This window should be launched by the first session creation command even though it may fail to locate it.
  2. The right attributes (accessibility id, name, or others) of this particular main window that you can use the Desktop Session to locate this Window element. inspect.exe is useful for this purpose.

Once you collected this information, you can have the following sequence to start your session:

  1. Create a session based on the application identifier
  2. Since the application always succeed to launch but failed to be located, create a Desktop Session
  3. Locate the application window and create a new session by attaching to it as shown below:
    https://github.com/Microsoft/WinAppDriver/blob/v1.0/README.md#attaching-to-an-existing-app-window

@hassanuz hassanuz added the FAQ label Dec 12, 2017
@anunayaabb
Copy link
Author

Thanks Margo for the response.
But how can I figure out what is accessibility id using inspect.exe , because i cant find any field as accessibility id in inspect.exe

@anunayaabb
Copy link
Author

Also inspect.exe shows a different PID and task manager shows different PID, I am struggling to figure out Appium driver takes which PID.

@timotiusmargo
Copy link
Contributor

Hi @anunayaabb,

As shown in the Supported Locators table in our readme, accessibility id refers to AutomationId in inspect.exe.

The ProcessId shown in inspect.exe is the right process that own the application window/UI. In UWP case however, the main application window (Windows.UI.Core.CoreWindow) which has the right ProcessId associated to your session is generally hosted in an ApplicationFrameWindow that has a different ProcessId. In such case, you should only care about the process id of the main application window.

@balaji-githubstore
Copy link

Try to include below capability which solved my issue of Failed to locate opened application window with appId"xxx" and process "xxx"

My exe file present in C:\Program Files\MT

appCapabilities.SetCapability("appWorkingDir", "C:\Program Files\MT");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants