question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failed to locate opened application window with appId: C:\Users\User\Desktop\xxx\xxx\xxx.exe, and processId: 14776

See original GitHub issue

I have a Windows Application with one single window (no splash screen, pop-ups or the like) which was working until recently. I’ve made no changes to the setup method, and cannot track down the cause of the issue. Both Task Manager and inspect.exe see the same process id as in the error message.

WinApp protocol:

POST /session HTTP/1.1
Accept: application/json, image/png
Connection: Keep-Alive
Content-Length: 185
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723


HTTP/1.1 500 Internal Error
Content-Length: 263
Content-Type: application/json

{"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\\Users\\user\\Desktop\\xxx\\xxx\\xxx\\xxx.exe, and processId: 14776"}}

My code:

public WindowsDriver<WindowsElement> CreateNewSession(string appId, string argument = null)
        {
            // Create a new session
            DesiredCapabilities appCapabilities = new DesiredCapabilities();
            appCapabilities.SetCapability("app", appId);
            return new WindowsDriver<WindowsElement>(new Uri(TestConfig.WindowsApplicationDriverUrl), appCapabilities);
        }

…where AppID is the path to my executable.

The app seems to hang up and refuse to launch until the test has failed, then is released and launches. It’s as if some process is hanging on to it. I have tried adding an implicit wait using TimeSpan when I create the new session, but the same problem still occurs (it just takes longer to happen).

As I said, this worked for weeks previously, and I’ve pored over any changes and cannot find any possible cause of the issue.

NOTE: my coworker pulled from the same branch, ran the same test, and it passes. Which just made me more frustrated.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

5reactions
balaji-githubstorecommented, Oct 12, 2020

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”);

1reaction
brandonwc5commented, Jun 5, 2019

Updating Appium fixed the issue! @naeemakram you were a great help.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to locate opened application window with appId"xxx" ...
WinAppDriver by default tries to locate the first top-level window with the same processID. It looks like WinAppDriver was unable to determine ...
Read more >
Failed to locate opened application window with appId: C: ...
Failed to locate opened application window with appId: C:\\Users\\XXX\\AppData\\Local\\Microsoft\\Teams\\current\\Teams.exe, and processId: ...
Read more >
OpenQA.Selenium.WebDriverException : Failed to locate ...
WebDriverException : Failed to locate opened application window with appId: C:\\WINDOWS\\System32\\taskschd.msc.
Read more >
Failed to locate opened application window with appId - ...
I'm trying to start the system/window32 application like “calculator and notepad” (.exe) its working fine but I have tried to start my own...
Read more >
Code is not able to locate my application - Support
... I am getting error as. Failed to locate opened application window with appId: C:\Windows\System32\calc.exe, and processId: 230124.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found