Failed to locate opened application window with appId: C:\Users\User\Desktop\xxx\xxx\xxx.exe, and processId: 14776
See original GitHub issueI 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:
- Created 4 years ago
- Comments:15 (1 by maintainers)
Top GitHub Comments
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”);
Updating Appium fixed the issue! @naeemakram you were a great help.