Sometimes during the tests I receive HTTP/1.1 500 Internal Error as below and the test is interrupted.
POST /session/A0697BE9-9484-44D5-8F63-D8CF51C24E2E/element/10956.279874872.0/click HTTP/1.1
Accept: application/json, image/png
Content-Length: 2
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{}
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
Is there any way to get more info what went wrong (any event logged?) or any workaround to such issues?
good question. We do seem to have a pretty generic error response for a lot of situations. We'll investigate.
To me, this happens all the time and sometimes when it hits, it seems to stuck, so all the next commands will fail the same way. I use to remedy this by stopping and starting WinAppDriver for every round of tests.
To Me, this happens all the time. Application is launching using
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", @"C:\Program Files (x86)\Windows Application Driver\Application.exe");
Session = new WindowsDriver
But if I check the values by hovering the mouse pointer at the Session variable, no information is displayed.
Its Unable to get hold of application even after launching.
Getting the following log in winappdriver
Windows Application Driver Beta listening for requests at: http://127.0.0.1:4723/
Press ENTER to exit.
==========================================
POST /session HTTP/1.1
Accept: application/json, image/png
Connection: Keep-Alive
Content-Length: 129
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
SessionManager - Creating session for C:\Program Files (x86)\Windows Application Driver\Application.exe
SessionManager - WinAppDriver succeeded loading MitaBroker
SessionManager - Application launched
SessionManager - Session successfully created: CD46F865-F9A4-48A5-B65B-A3BE94AC7B6C
HTTP/1.1 200 OK
Content-Length: 152
Content-Type: application/json
{"sessionId":"CD46F865-F9A4-48A5-B65B-A3BE94AC7B6C","status":0,"value":{"app":"C:\Program Files (x86)\Windows Application Driver\Application.exe"}}
==========================================
POST /session/CD46F865-F9A4-48A5-B65B-A3BE94AC7B6C/element HTTP/1.1
Accept: application/json, image/png
Content-Length: 53
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"using":"accessibility id","value":"txtEMSUsername"}
HTTP/1.1 200 OK
Content-Length: 96
Content-Type: application/json
{"sessionId":"CD46F865-F9A4-48A5-B65B-A3BE94AC7B6C","status":0,"value":{"ELEMENT":"42.2167650"}}
==========================================
POST /session/CD46F865-F9A4-48A5-B65B-A3BE94AC7B6C/element/42.2167650/value HTTP/1.1
Accept: application/json, image/png
Content-Length: 22
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"value":["sysadmin"]}
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
Any news about this issue ?
Is there any updates? I get the same issue constantly.
It launches the application but fails after. It launches successfully only if previous launches is failed so the instance of the is up and running( it can't be disposed after failed run).
\Windows Application Driver>WinAppDriver.exe
Windows Application Driver Beta listening for requests at: http://127.0.0.1:4723/
Press ENTER to exit.
==========================================
POST /session HTTP/1.1
Accept: application/json, image/png
Connection: Keep-Alive
Content-Length: 177
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"desiredCapabilities":{"app":"D:\rep\allo\Allo.exe","deviceName":"WindowsPC","platformName":"Windows"}}
SessionManager - Creating session
SessionManager - WinAppDriver succeeded loading MitaBroker
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
==========================================
POST /session HTTP/1.1
Accept: application/json, image/png
Connection: Keep-Alive
Content-Length: 177
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"desiredCapabilities":{"app":"D:\rep\allo\Allo.exe","deviceName":"WindowsPC","platformName":"Windows"}}
SessionManager - Creating session
SessionManager - WinAppDriver succeeded loading MitaBroker
SessionManager - Application launched
SessionManager - Session successfully created: 424D133E-B1F1-472D-9C05-FCA043714426
HTTP/1.1 200 OK
Content-Length: 200
Content-Type: application/json
{"sessionId":"424D133E-B1F1-472D-9C05-FCA043714426","status":0,"value":{"app":"D:\rep\allo\Allo.exe","platformName":"Windows"}}
==========================================
POST /session/424D133E-B1F1-472D-9C05-FCA043714426/timeouts HTTP/1.1
Accept: application/json, image/png
Content-Length: 31
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"type":"implicit","ms":4000.0}
HTTP/1.1 200 OK
Content-Length: 63
Content-Type: application/json
{"sessionId":"424D133E-B1F1-472D-9C05-FCA043714426","status":0}
Not sure what could cause this. In the v1.0 release we'll be displaying more info in error situations. If you could try again with v1.0 when we release it that would be a big help. Hoping to have it out later this month.
Me too facing same issue while launching application and it is a show stopper for me to proceed further since application session is not created.
Appreciate if this issue is taken as high priority.
POST /session HTTP/1.1
Accept: application/json, image/png
Connection: Keep-Alive
Content-Length: 263
Content-Type: application/json;charset=utf-8
Host: 127.0.0.1:4723
{"desiredCapabilities":{"app":"C:\App\Client\setup.exe","deviceName":"WindowsPC","platformName":"Windows"},"capabilities":{"firstMatch":[{"app":"C:\App\Client\setup.exe","deviceName":"WindowsPC","platformName":"Windows"}]}}
SessionManager - Creating session
SessionManager - WinAppDriver succeeded loading MitaBroker
HTTP/1.1 500 Internal Error
Content-Length: 133
Content-Type: application/json
{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}
Mahendra
Hi guys,
I met same issue when I was evaluating WinAppDriver v0.9 release, pls make sure if you've called Quit( ) method of windows driver instance before you quit test session. In my case, after adding that sentence, I don't see HTTP 500 Error anymore, my test cases can be executed continuously.
Cheers,
Alex
We recently released Windows Application Driver v1.0-RC. This version is not only more robust and stable, but it also returns more meaningful exceptions in the case of known error.
To ensure that no issues getting unnoticed, would you please:
If you still encounter the same unknown error issue and not during session creation, please post the exact repro steps in this thread. If you still encounter the unknown error during session creation, you may want to do a quick search for other similar issues or create a new one as it may be specific to your application launch sequence.
I have downloaded v1.0-RC, but I have an issue with my tests when I am trying to send Alt key.
It worked perfectly with v0.9 but does not work with 1.0RC (I uninstalled 1.0, tested 0.9, then re-installed 1.0 to make sure the 1.0 is the issue).
What I do is to show the Browse for folder window and then send LeftAlt + "a" like this:
driver.FindElementByAccessibilityId("browseButton").Click(); // This clicks on the browse for folder button in my app
driver.FindElementByAccessibilityId("41477"); // To make sure the window is displayed
driver.Keyboard.SendKeys(OpenQA.Selenium.Keys.LeftAlt + "a" + OpenQA.Selenium.Keys.LeftAlt);
This last line should select the text in the top bar, but instead it somehow puts the focus to the main window (which is impossible normally as the browse for folder button is modal!) and the text is never selected.
I need this to work before I can retry all my tests to catch the 500 internal error as it happened after a while.
Hi @RafalSkorka,
What you observe is the fact that action on element such as (click, clear, input text, etc.) now ensures that the application window is in focus. Enforcing focus on the application/top level window seems to help in many other scenarios. Could you please try refocusing on your address box as you already have reference to it (e.g. element with appId 41477)? Sometimes it is useful too to use different keyboard shortcut like Alt + d to highlight the address bar and so on.
How do I enforce the focus on the application top level window?
You can use the switch to window API and provide the current application window to set focus on the application top level window. E.g.
c#
// Set focus on the application by switching window to itself
session.SwitchTo().Window(session.CurrentWindowHandle);
What I meant to say previously is in the current version, Windows Application Driver always implicitly set focus on the application top level window associated with the session before performing any actions such as click, clear, and sendKeys. This was added to handle the case where the application window is blocked by other window during the test.
The problem is when I send keys to the already focused top window the app driver refocuses the window to the main app window. I have uploaded a video with this behavior here: https://www.youtube.com/watch?v=HPn6WVHZdRc
This is a fragment of test code that clicks on the browse button in the app, waits for the window to be displayed, waits 5 seconds, then sends some keys to an edit box. This changes the focus to the main app window (as can be seen by the activating Back arrow in the top left and dimmed title bar in the pop up window). The same happens if I just send keys from driver.Keyboard.
This worked properly in pre-1.0 versions.
Thank you for bringing up the focusing issue @RafalSkorka! This scenario was not easy to catch and you provided excellent steps and details to reproduce the behavior. We agree that behavior you saw on v1.0-RC is broken and I have made a fix that will become ready sometimes soon.
In the meantime, I have found a workaround for my problem and run all tests I had - no 500 Internal Error encountered, so I believe this issue can be closed for now. If I have an issue with the v1.0 I will post a new one.
I am using the latest version 0.24 of appium-python-client
this runs fine on 1.08: driver.location
on 1.0RC i get: http/1.1 internal error 500 internal error
any problems with appium and winappdriver?
Hi @ttlnd,
Would you please create a new issue with a specific repro steps (i.e. the mobile JSON wire protocol payload you find on WinAppDriver.exe console window? We also recently released v1,0-RC2. Would you please re-test your scenario against this latest version?
Hi @RafalSkorka,
The fix for the issue you discovered is in the v1.0-RC2 release. This should restore the window focus behavior on key input behavior.
@timotiusmargo, The RC2 works great! and is extremely quick comparing to previous releases.
Thanks for the verification and for bringing the issue up in the first place @RafalSkorka!
Most helpful comment
@timotiusmargo, The RC2 works great! and is extremely quick comparing to previous releases.