microsoft / WinAppDriver

Windows Application Driver
MIT License
3.66k stars 1.4k forks source link

Jenkins, [WinAppDriver] WinAppDriver exited unexpectedly with code 2147500037, signal null #695

Open kbasav1 opened 5 years ago

kbasav1 commented 5 years ago

Hi,

Currently when I run Appium tests using Jenkins , I am getting below error message. But same will work when we run test locally in the server without Jenkins. Can you please let me know how we run Appium server through Jenkins and run the tests.

16:20:02 [WinAppDriver] WinAppDriver exited unexpectedly with code 2147500037, signal null 16:20:02 16:20:02 Error Message: An element could not be located on the page using the given search parameters. 16:20:02 Stacktrace: 16:20:02 at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse) 16:20:02 at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary2 parameters) 16:20:02 at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value) 16:20:02 at OpenQA.Selenium.Appium.AppiumDriver1.FindElement(String by, String value) 16:20:02 at UI.Automation.Core.Utility.InitializeOrphanedSession() in .....\Source\Repos\UI-Automation\UI.Automation.Core\Utility.cs:line 116

Installed nodejs ,npm and appium versions are :

C:\Windows\system32>node -v v10.15.3

C:\Windows\system32>npm -v 6.4.1

C:\Windows\system32>appium -v 1.11.0

Also added below in PATH environment variables

%USERPROFILE%\AppData \Roaming\npm; C:\Program Files\nodejs C:\Program Files\nodejs\node_modules\npm\bin;

Appium tests are running using command :gauge.exe run specs\UserGet.spec

ranjithsanda commented 5 years ago

Hi I am using the latest version of WinAppDriver i.e. 1.1, but still i am getting the same error, Test environment details: Windows 10 machine WinAppDriver V1.1 Appium Version 1.13 AppType: Windows Store app

Here are the log details, could you plz help me out asap as i am doing tool evaluation for windows app testing.

[Appium] Welcome to Appium v1.13.0 [Appium] Non-default server args: [Appium] address: 127.0.0.1 [Appium] Appium REST http interface listener started on 127.0.0.1:4723 [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","platformName":"Windows","deviceName":"WindowsPC","appiumVersion":"1.12.1"},"capabilities":{"firstMatch":[{"appium:app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","appium:appiumVersion":"1.12.1","appium:deviceName":"WindowsPC","platformName":"windows"}]}} [W3C] Calling AppiumDriver.createSession() with args: [{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","platformName":"Windows","deviceName":"WindowsPC","appiumVersion":"1.12.1"},null,{"firstMatch":[{"appium:app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","appium:appiumVersion":"1.12.1","appium:deviceName":"WindowsPC","platformName":"windows"}]}] [BaseDriver] Event 'newSessionRequested' logged at 1558527861569 (17:54:21 GMT+0530 (India Standard Time)) [Appium] Appium v1.13.0 creating new WindowsDriver (v1.5.1) session [Appium] Capabilities: [Appium] platformName: windows [Appium] app: Microsoft.WindowsCalculator_8wekyb3d8bbwe [Appium] appiumVersion: 1.12.1 [Appium] deviceName: WindowsPC [BaseDriver] Creating session with MJSONWP desired capabilities: {"app":"Microsoft.WindowsCa... [BaseDriver] The following capabilities were provided, but are not recognized by appium: app, appiumVersion. [BaseDriver] Session created with session id: 4f996797-cd89-4569-8122-d914242388c7 [WinAppDriver] You must use WinAppDriver version 1.1 [WinAppDriver] Verifying WinAppDriver version 1.1 is installed via comparing the checksum. [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 [WD Proxy] Proxying [GET /status] to [GET http://127.0.0.1:4724/wd/hub/status] with no body [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] ========================================== [WinAppDriver] [STDOUT] GET /wd/hub/status HTTP/1.1 [WinAppDriver] [STDOUT] Accept: application/json, / [WinAppDriver] [STDOUT] Connection: close [WinAppDriver] [STDOUT] Content-Type: application/json; charset=utf-8 [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: 147 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {"build":{"revision":"18001","time":"Tue Sep 18 18:35:38 2018","version":"1.1.1809"},"os":{"arch":"amd64","name":"windows","version":"10.0.17134"}} [WD Proxy] Got response with status 200: "{\"build\":{\"revision\":\"18001\",\"time\":\"Tue Sep 18 18:35:38 2018\",\"version\":\"1.1.1809\"},\"os\":{\"arch\":\"amd64\",\"name\":\"windows\",\"version\":\"10.0.17134\"}}" [WD Proxy] Determined that the downstream protocol for proxy is undefined [WinAppDriver] Status call returned 200. we're online and ready to run tests [WinAppDriver] WinAppDriver changed state to 'online' [WD Proxy] Matched '/session' to command name 'createSession' [WD Proxy] Proxying [POST /session] to [POST http://127.0.0.1:4724/wd/hub/session] with body: {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","platformName":"Windows","deviceName":"WindowsPC","appiumVersion":"1.12.1"}} [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] ========================================== [WinAppDriver] [STDOUT] POST /wd/hub/session HTTP/1.1 [WinAppDriver] [STDOUT] Accept: application/json, / [WinAppDriver] [STDOUT] Connection: close [WinAppDriver] [STDOUT] Content-Length: 150 [WinAppDriver] [STDOUT] Content-Type: application/json; charset=utf-8 [WinAppDriver] [STDOUT] Host: 127.0.0.1:4724 [WinAppDriver] [STDOUT] User-Agent: appium [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {"desiredCapabilities":{"app":"Microsoft.WindowsCalculator_8wekyb3d8bbwe","platformName":"Windows","deviceName":"WindowsPC","appiumVersion":"1.12.1"}} [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] Address 'http://127.0.0.1:4724/wd/hub' is already in use [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] Failed to initialize: 0x80004005 [WinAppDriver] WinAppDriver exited unexpectedly with code 2147500037, signal null [WinAppDriver] WinAppDriver changed state to 'stopped' [WinAppDriver] [STDOUT] HTTP/1.1 500 Internal Error [WinAppDriver] [STDOUT] Content-Length: 101 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WD Proxy] Got an unexpected response: {"status":13,"value":{"error":"unknown error","message":"The system cannot find the file specified"}} [W3C] Matched W3C error code 'unknown error' to UnknownError [WinAppDriver] Deleting WinAppDriver session [BaseDriver] Event 'newSessionStarted' logged at 1558527862651 (17:54:22 GMT+0530 (India Standard Time)) [W3C] Encountered internal error running command: UnknownError: An unknown server-side error occurred while processing the command. Original error: The system cannot find the file specified [W3C] at errorFromW3CJsonCode (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:802:25) [W3C] at ProxyRequestError.errorFromW3CJsonCode [as getActualError] (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\protocol\errors.js:685:14) [W3C] at JWProxy.getActualError [as command] (C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\appium-base-driver\lib\jsonwp-proxy\proxy.js:235:19) [HTTP] <-- POST /wd/hub/session 500 1084 ms - 870 [HTTP]

sasha943 commented 5 years ago

I have the same error when try to call session.launchApp()

[MJSONWP (f8a97777)] Driver proxy active, passing request on via HTTP proxy [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] ========================================== [WinAppDriver] [STDOUT] POST /wd/hub/session/12DBE27C-9EF4-4F84-A0F9-556C39B31614/appium/app/launch HTTP/1.1 [WinAppDriver] [STDOUT] Accept: application/json, */* [WinAppDriver] [STDOUT] Connection: close [WinAppDriver] [STDOUT] Content-Length: 2 [WinAppDriver] [STDOUT] Content-Type: application/json; charset=utf-8 [WinAppDriver] [STDOUT] Host: 127.0.0.1:4724 [WinAppDriver] [STDOUT] User-Agent: appium [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] HTTP/1.1 500 Internal Error [WinAppDriver] [STDOUT] Content-Length: 133 [WinAppDriver] [STDOUT] Content-Type: application/json [WinAppDriver] [STDOUT] [WinAppDriver] [STDOUT] {"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}} [WD Proxy] Got an unexpected response: {"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}} [HTTP] <-- POST /wd/hub/session/f8a97777-80fe-4482-a52f-d4fda4b7b4f0/appium/app/launch 500 7217 ms - 244 [HTTP]

ranjithsanda commented 5 years ago

I had fixed the issue and was able to launch both the windows calculator app and my project app and could able to perform actions on UI elements. Can u post the capabilities your are passing to Appium

rrchcr8 commented 4 years ago

is it possible to use WinAppDriver in CI with Jenkins?