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.

Test fails with "Failed to locate opened application window with appId"

See original GitHub issue

Hi all, I started having this problem when the driver fails to locate the app around a month ago. I am getting it approximately 3/4 times I am trying to run tests. Right now it makes it impossible to have a stable automation running.

Here is the full log: (I replaced app path with xxx…)

C:\Users\xxx>appium [Appium] Welcome to Appium v1.7.2 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 [HTTP] --> POST /wd/hub/session {“desiredCapabilities”:{“app”:“Z:\xxx\xxx\xxxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“Windows”,“platormName”:“Windows”},“capabilities”:{“desiredCapabilities”:{“app”:“Z:\xxx\xxx\xxxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“Windows”,“platormName”:“Windows”},“firstMatch”:[{“platformName”:“windows”}]}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“Z:\xxx\xxx\xxxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“Windows”,“platormName”:“Windows”},null,{“desiredCapabilities”:{“app”:“Z:\xxx\xxx\xxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“Windows”,“platormName”:“Windows”},“firstMatch”:[{“platformName”:“windows”}]}] [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1519059770835 (17:02:50 GMT+0000 (GMT Standard Time)) [Appium] Merged W3C capabilities {“desiredCapabilities”:{“app”:"Z:\xxx\xx… into desiredCapabilities object {“app”:"Z:\xxx\xxx\xxxx\xxx…

[Appium] Creating new WindowsDriver (v1.0.0) session [Appium] Capabilities: [Appium] app: Z:\xxx\xxx\xxx\xxx.exe [Appium] deviceName: WindowsPC [Appium] platformName: windows [Appium] platormName: Windows

[BaseDriver] The following capabilities were provided, but are not recognized by appium: app, platormName. [BaseDriver] Session created with session id: 34080115-3191-4b3b-933d-9d7b403b05f6

[WinAppDriver] You must use WinAppDriver version 1.0 [WinAppDriver] Verifying WinAppDriver version 1.0 is installed via comparing the checksum.

[debug] [WinAppDriver] WinAppDriver changed state to ‘starting’ [WinAppDriver] Killing any old WinAppDrivers on same port, running: FOR /F “usebackq tokens=5” %a in (netstat -nao ^| findstr /R /C:"4724 ") do (FOR /F “usebackq” %b in (TASKLIST /FI "PID eq %a" ^| findstr /I winappdriver.exe) do (IF NOT %b==“” TASKKILL /F /PID %a)) [WinAppDriver] No old WinAppDrivers seemed to exist [WinAppDriver] Spawning winappdriver with: 4724/wd/hub [WinAppDriver] [STDOUT] Windows Application Driver listening for requests at: http://127.0.0.1:4724/wd/hub [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body [WinAppDriver] [STDOUT] Press ENTER to exit. [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] ========================================== [WinAppDriver] [STDOUT] GET /wd/hub/status HTTP/1.1 [WinAppDriver] [STDOUT] Accept: / [WinAppDriver] [STDOUT] Connection: keep-alive [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] Host: 127.0.0.1:4724 [WinAppDriver] [STDOUT] User-Agent: appium [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] HTTP/1.1 200 OK [WinAppDriver] [STDOUT] Content-Length: 139 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {“build”:{“revision”:“17001”,“time”:“Tue Oct 17 18:04:03 2017”,“version”:“1.0.1710”},“os”:{“arch”:“amd64”,“name”:“windows”,“version”:“10”}} [debug] [JSONWP Proxy] Got response with status 200: “{"build":{"revision":"17001","time":"Tue Oct 17 18:04:03 2017","version":"1.0.1710"},"os":{"arch":"amd64","name":"windows","version":"10"}}” [WinAppDriver] Status call returned 200. we’re online and ready to run tests [debug] [WinAppDriver] WinAppDriver changed state to ‘online’ [debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {“desiredCapabilities”:{“app”:“Z:\xxx\xxx\xxxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“windows”,“platormName”:“Windows”}} [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] ========================================== [WinAppDriver] [STDOUT] POST /wd/hub/session HTTP/1.1 [WinAppDriver] [STDOUT] Accept: / [WinAppDriver] [STDOUT] Connection: keep-alive [WinAppDriver] [STDOUT] Content-Length: 186 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] Host: 127.0.0.1:4724 [WinAppDriver] [STDOUT] User-Agent: appium [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {“desiredCapabilities”:{“app”:“Z:\xxx\xxx\xxxx\xx.exe”,“deviceName”:“WindowsPC”,“platformName”:“windows”,“platormName”:“Windows”}} [WinAppDriver] [STDOUT] HTTP/1.1 500 Internal Error [WinAppDriver] [STDOUT] Content-Length: 214 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {“status”:13,“value”:{“error”:“unknown error”,“message”:“Failed to locate opened application window with appId:Z:\xxx\xxx\xxxx\xx.exe, and processId: 7000”}} [debug] [WinAppDriver] Deleting WinAppDriver session [MJSONWP] Encountered internal error running command: {“w3cStatus”:400,“jsonwp”:{“status”:13,“value”:{“error”:“unknown error”,“message”:“Failed to locate opened application window with appId: Z:\xxx\xxx\xxxx\xx.exe, and processId: 7000”}}} ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {“status”:13,“value”:{“error”:“unknown error”,“message”:“Failed to locate opened application window with appId: Z:\xxx\xxx\xxxx\xx.exe, and processId: 7000”}} at JWProxy.proxy$ (C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:152:13) at tryCatch (C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40) at GeneratorFunctionPrototype.invoke [as _invoke] (C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:315:22) at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js💯21) at GeneratorFunctionPrototype.invoke (C:\Users\xxx\AppData\Roaming\npm\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37) at <anonymous> [HTTP] <-- POST /wd/hub/session 500 7023 ms - 152

The test obviously fails but the app is actually launched. So location is not an issue. Is there something I am doing wrong? It used to work fine…?

I am using Appium from node version 1.7.2 WindowsDriver (v1.0.0)

Many thanks, Ewa

Issue Analytics

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

github_iconTop GitHub Comments

3reactions
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
RSI-Repocommented, Jan 22, 2021

@balaji-githubstore How did that work, I thought that SetCapability was depreciated.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Failed to locate opened application window with appId"xxx" ...
Using Inspect.exe I can see that the Process ID is correct but the AutomationId is blank for my WPF application under test. I...
Read more >
Failed to locate opened application window with appId - ...
Hi, I'm new a beginner in the katalon studio, So I'm facing some issues while running the test cases. I'm trying to start...
Read more >
OpenQA.Selenium.WebDriverException : Failed to locate ...
taskschd test issue: OpenQA.Selenium.WebDriverException : Failed to locate opened application window with appId: C:\\WINDOWS\\System32\\taskschd ...
Read more >
Code is not able to locate my application - Support
I tried with \ and still see error. Basically the error I am observing is: “Failed to locate opened application window with appId:C:\Windows\ ......
Read more >
appium-windows-driver
Appium Windows Driver supports testing Universal Windows Platform (UWP), ... of UWP applications (aka Failed to locate opened application window with appId: ...
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