Open hhdd92 opened 4 years ago
Since Teams has a splash screen when starting you probably have to attach to the new window that it creates. Some details linked in this other issue: https://github.com/microsoft/WinAppDriver/issues/1341
Thank you @Wolfe1 , I will have a try.
You can try to use desktopsession
Hi,
I am using Appium to test Microsoft Teams on my local machine, however I got the below error, could you help to take a look? Thanks. The program could start the Teams app, but then counter the below errors. Any suggestion will be welcome.
OS: windows 10 Appium: 1.18.3 windows app driver: 1.2.1910.2002 Node: 12.18.2
[info] [35m[Appium][39m Welcome to Appium v1.18.3 [info] [35m[Appium][39m Non-default server args: [info] [35m[Appium][39m relaxedSecurityEnabled: true [info] [35m[Appium][39m allowInsecure: { [info] [35m[Appium][39m } [info] [35m[Appium][39m denyInsecure: { [info] [35m[Appium][39m } [info] [35m[Appium][39m Appium REST http interface listener started on 0.0.0.0:4723[debug] [35m[HTTP][39m Request idempotency key: 3cdde18a-26a9-43f8-a299-af00e7dda35d [info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [info] [35m[HTTP][39m [90m{"capabilities":{"firstMatch":[{"platformName":"Windows","appium:deviceName":"WindowsPC","appium:noReset":true,"appium:app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}]},"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}}[39m [debug] [35m[W3C][39m Calling AppiumDriver.createSession() with args: [{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"},null,{"firstMatch":[{"platformName":"Windows","appium:deviceName":"WindowsPC","appium:noReset":true,"appium:app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}]}] [debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1603773482957 (21:38:02 GMT-0700 (Pacific Daylight Time)) [info] [35m[Appium][39m Appium v1.18.3 creating new WindowsDriver (v1.13.0) session [info] [35m[Appium][39m Applying relaxed security to 'WindowsDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: { [debug] [35m[BaseDriver][39m "platformName": "Windows", [debug] [35m[BaseDriver][39m "deviceName": "WindowsPC", [debug] [35m[BaseDriver][39m "noReset": true, [debug] [35m[BaseDriver][39m "app": "C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe" [debug] [35m[BaseDriver][39m } [info] [35m[BaseDriver][39m Session created with session id: 105f0d87-84f8-4dbb-83bc-732c0920ea4e[info] [35m[WinAppDriver][39m No old WinAppDrivers seemed to exist [info] [35m[WinAppDriver][39m Spawning WinAppDriver with: 4724/wd/hub [info] [35m[WinAppDriver][39m [STDOUT] Windows Application Driver listening for requests at: http://127.0.0.1:4724/wd/hub [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body [info] [35m[WinAppDriver][39m [STDOUT] Press ENTER to exit. [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] GET /wd/hub/status HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: keep-alive [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [debug] [35m[WD Proxy][39m Got response with status 200: {"build":{"revision":"2002","time":"Wed Oct 2 21:08:40 2019","version":"1.2.1910"},"os":{"arch":"amd64","name":"windows","version":"10.0.19042"}} [info] [35m[WinAppDriver][39m Status call returned 200. we're online and ready to run tests [debug] [35m[WinAppDriver][39m WinAppDriver changed state to 'online' [debug] [35m[WinAppDriver][39m Starting WinAppDriver session. Will timeout in '20000' ms. [debug] [35m[WD Proxy][39m Matched '/session' to command name 'createSession' [debug] [35m[WD Proxy][39m Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}} [info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 200 OK [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 146 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"build":{"revision":"2002","time":"Wed Oct 2 21:08:40 2019","version":"1.2.1910"},"os":{"arch":"amd64","name":"windows","version":"10.0.19042"}} [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: keep-alive [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 171 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}}[info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 500 Internal Error [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 209 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [info] [35m[WD Proxy][39m Got response with status 500: {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError [warn] [35m[WinAppDriver][39m Could not start WinAppDriver session error = 'An unknown server-side error occurred while processing the command. Original error: Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740', attempt = '1' from 'undefined'[debug] [35m[WD Proxy][39m Matched '/session' to command name 'createSession' [debug] [35m[WD Proxy][39m Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}} [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: keep-alive [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 171 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 500 Internal Error [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 209 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [info] [35m[WD Proxy][39m Got response with status 500: {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError [warn] [35m[WinAppDriver][39m Could not start WinAppDriver session error = 'An unknown server-side error occurred while processing the command. Original error: Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740', attempt = '2' from 'undefined'[debug] [35m[WD Proxy][39m Matched '/session' to command name 'createSession' [debug] [35m[WD Proxy][39m Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}} [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: keep-alive [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 171 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 500 Internal Error [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 209 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [info] [35m[WD Proxy][39m Got response with status 500: {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError [warn] [35m[WinAppDriver][39m Could not start WinAppDriver session error = 'An unknown server-side error occurred while processing the command. Original error: Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740', attempt = '3' from 'undefined'[debug] [35m[WD Proxy][39m Matched '/session' to command name 'createSession' [debug] [35m[WD Proxy][39m Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}} [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] ========================================== [info] [35m[WinAppDriver][39m [STDOUT] POST /wd/hub/session HTTP/1.1 [info] [35m[WinAppDriver][39m [STDOUT] Accept: application/json, / [info] [35m[WinAppDriver][39m [STDOUT] Connection: keep-alive [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 171 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json; charset=utf-8 [info] [35m[WinAppDriver][39m [STDOUT] Host: 127.0.0.1:4724 [info] [35m[WinAppDriver][39m [STDOUT] User-Agent: appium [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}}[info] [35m[WinAppDriver][39m [STDOUT] HTTP/1.1 500 Internal Error [info] [35m[WinAppDriver][39m [STDOUT] Content-Length: 209 [info] [35m[WinAppDriver][39m [STDOUT] Content-Type: application/json [info] [35m[WinAppDriver][39m [STDOUT] [info] [35m[WinAppDriver][39m [STDOUT] {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [info] [35m[WD Proxy][39m Got response with status 500: {"status":13,"value":{"error":"unknown error","message":"Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740"}} [debug] [35m[W3C][39m Matched W3C error code 'unknown error' to UnknownError [warn] [35m[WinAppDriver][39m Could not start WinAppDriver session error = 'An unknown server-side error occurred while processing the command. Original error: Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740', attempt = '4' from 'undefined' [debug] [35m[WinAppDriver][39m timeoutError was Condition unmet after 23766 ms. Timing out. [debug] [35m[WinAppDriver][39m Deleting WinAppDriver session [debug] [35m[BaseDriver][39m Event 'newSessionStarted' logged at 1603773507405 (21:38:27 GMT-0700 (Pacific Daylight Time)) [debug] [35m[W3C][39m Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: Failed to locate opened application window with appId: C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe, and processId: 34740 [debug] [35m[W3C][39m at errorFromW3CJsonCode (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:780:25) [debug] [35m[W3C][39m at ProxyRequestError.getActualError (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:663:14) [debug] [35m[W3C][39m at JWProxy.command (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:278:19) [debug] [35m[W3C][39m at processTicksAndRejections (internal/process/task_queues.js:85:5) [debug] [35m[W3C][39m Destroying socket connection [info] [35m[HTTP][39m [37m<-- POST /wd/hub/session [39m[31m500[39m [90m24482 ms - 1113[39m [info] [35m[HTTP][39m [90m[39m[debug] [35m[HTTP][39m Request idempotency key: de50b983-b6cf-48da-b5b6-7e2fa6eb7adc [info] [35m[HTTP][39m [37m-->[39m [37mPOST[39m [37m/wd/hub/session[39m [info] [35m[HTTP][39m [90m{"capabilities":{"firstMatch":[{"platformName":"Windows","appium:deviceName":"WindowsPC","appium:noReset":true,"appium:app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}]},"desiredCapabilities":{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}}[39m [debug] [35m[W3C][39m Calling AppiumDriver.createSession() with args: [{"platformName":"Windows","deviceName":"WindowsPC","noReset":true,"app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"},null,{"firstMatch":[{"platformName":"Windows","appium:deviceName":"WindowsPC","appium:noReset":true,"appium:app":"C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe"}]}] [debug] [35m[BaseDriver][39m Event 'newSessionRequested' logged at 1603773508475 (21:38:28 GMT-0700 (Pacific Daylight Time)) [info] [35m[Appium][39m Appium v1.18.3 creating new WindowsDriver (v1.13.0) session [info] [35m[Appium][39m Applying relaxed security to 'WindowsDriver' as per server command line argument. All insecure features will be enabled unless explicitly disabled by --deny-insecure [debug] [35m[BaseDriver][39m Creating session with MJSONWP desired capabilities: { [debug] [35m[BaseDriver][39m "platformName": "Windows", [debug] [35m[BaseDriver][39m "deviceName": "WindowsPC", [debug] [35m[BaseDriver][39m "noReset": true, [debug] [35m[BaseDriver][39m "app": "C:\Users\xxx\AppData\Local\Microsoft\Teams\current\Teams.exe" [debug] [35m[BaseDriver][39m } [info] [35m[BaseDriver][39m Session created with session id: f79c9b5c-8fcc-4e54-86b9-c010a03e8a92 [debug] [35m[WinAppDriver][39m WinAppDriver changed state to 'starting' [info] [35m[WinAppDriver][39m 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))[info] [35m[WinAppDriver][39m No old WinAppDrivers seemed to exist [info] [35m[WinAppDriver][39m Spawning WinAppDriver with: 4724/wd/hub [info] [35m[WinAppDriver][39m [STDOUT] Windows Application Driver listening for requests at: http://127.0.0.1:4724/wd/hub [debug] [35m[WD Proxy][39m Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body