WinAppDriver icon indicating copy to clipboard operation
WinAppDriver copied to clipboard

WinAppDriver 0.7 - Run Elevated Fails with status 13 value error - "An unknown error occurred in the remote end while processing the command."

Open ianceicys opened this issue 9 years ago • 34 comments

image

repo of the issue: Video walkthrough

Trying to write an automated test that interacts with Microsoft Word 2016 and I am receiving the following error:

========================================== POST /session HTTP/1.1 Accept: application/json, image/png Connection: Keep-Alive Content-Length: 125 Content-Type: application/json;charset=utf-8 Host: 127.0.0.1:4723

{"desiredCapabilities":{"app":"C:\Program Files (x86)\Microsoft Office\root\Office16\WINWORD.EXE","platformName":"iOS"}} 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."}}

Source : https://github.com/ianceicys/WinAppDriver/blob/89c6726c891f3efc9af3dd4dc31cc238a20a2d70/Samples/C%23/WordTest/Scenario.cs

ianceicys avatar Dec 05 '16 21:12 ianceicys

I'm seeing this same thing, but my application isn't in a protected folder(C:\TeklaStructures). I'm running as admin because visual studio is on my local machine and the application i'm testing is on a vm. The problem is intermittent for me. Works for a while then quits, then works for a while. Can't seem to track down how to get it to work/not work consistently.

sproatba avatar Dec 12 '16 20:12 sproatba

@sproatba One thing I've seen with intermittent failures is having to close and restart the WinAppDriver.exe process ("C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe") at the beginning and end of each test. I seem to get more reliable failures (at least the same failure when I have a new process at the beginning of each test).

ianceicys avatar Dec 13 '16 14:12 ianceicys

I am also facing the same issue. Am trying to automate a wpf application. Tests are failing most of the times because of this issue. On an average out of 10 attempts it fails 7-8 times. Having hard time to run the tests. Please let me know if there is a fix or workaround for this issue. Note: I restart the WinAppDriver every time i run the test , still it fails with the issue " An unknown error occurred in the remote end while processing the command"

vijayalakshmi-ml avatar Dec 19 '16 18:12 vijayalakshmi-ml

Can we expect the fix for this issue in the next release? This is a major issue we are facing here. Not able to run the tests because of this issue. Request to fix this issue ASAP

vijayalakshmi-ml avatar Dec 22 '16 19:12 vijayalakshmi-ml

Hi team, Just curious to know when is the next release. Expecting the fix for this issue in the next release .

I have done some tests using Winappdriver in our application. My team is in the deciding phase. I have to give a presentation of the working code. But the tests are failing because of this issue. Request the team to kindly provide the fix in the next release asap.

vijayalakshmi-ml avatar Jan 17 '17 20:01 vijayalakshmi-ml

Have you tried opening WinAppDriver as admin?

hakkori avatar Jan 18 '17 13:01 hakkori

I see the same issue. I'm trying to switch from my application to Powerpoint to do a quick verification and then back to my application. Starting the driver with Powerpoint works only some of the times, very inconsistent. I have also tried running WInAppDriver as admin too.

Heres a typical attempt to start up Powerpoint:

POST /session HTTP/1.1
Accept-Encoding: gzip,deflate
Connection: Keep-Alive
Content-Length: 126
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4733
User-Agent: Apache-HttpClient/4.5.2 (Java/1.8.0_101)

{"desiredCapabilities":{"app":"C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\POWERPNT.exe","platformName":"iOS"}}
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."}}

tylerrrrrr avatar Jan 18 '17 17:01 tylerrrrrr

I haven't been able to repro this using the following apps. WordAppId = @"C:\Program Files\Microsoft Office\Office16\WINWORD.exe"; WordAppId = @"C:\Program Files (x86)\WinAppDriverAdminTest\wpfnotepad.exe"; 

I'm using Windows Creators update insider release of Windows, and Visual Studio 2015 w/Update 3.

What Windows OS and Visual Studio version are people using?

yodurr avatar Jan 21 '17 01:01 yodurr

@yodurr Application: C:\Program Files (x86)\Microsoft Office\root\Office16\POWERPNT.exe OS: Windows 10 Enterprise. Version: 1511. OS build: 10586.753

Also we are not using Visual Studios for development, we use Java & Eclipse for example.

tylerrrrrr avatar Jan 23 '17 16:01 tylerrrrrr

@yodurr Am using visual studio for developing the tests. Below are the details Windows - Microsoft Windows [Version 10.0.14393] Visual studio Community 2015 , Version 14.0.25431.01 Update 3

Am still getting the below error as I run the tests.

{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}"

Is there a way to check the logs for this error. Because all we can see is the above error in the Winappdriver. I am working in a wpf application ,it takes 2-3 seconds to load , is that a reason for this issue?

Note: I ran Winappdriver as admin , still it didnt help. The tests failed with this error

vijayalakshmi-ml avatar Jan 23 '17 17:01 vijayalakshmi-ml

Please let us know when we can expect a fix for this issue.

vijayalakshmi-ml avatar Jan 31 '17 18:01 vijayalakshmi-ml

Ok, found one bug and we'll get a fix out in the next release (asap).  The uppercase ".EXE" is currently not getting identified correctly and we'll fix this so you can use .EXE. In the meantime only use all lowercase ".exe" in the app path.

I don't believe this is the root cause for all issues on this thread so am not suggesting this bug is fixed, but hopefully this info helps some of you.  

yodurr avatar Feb 02 '17 22:02 yodurr

Will this fix solve the "unknown error " issue ? If not please let us know when the "unknown error" issue will be fixed, so that we can plan accordingly. This "unknown error "issue is a blocker

vijayalakshmi-ml avatar Feb 02 '17 23:02 vijayalakshmi-ml

it solves the unknown error issue if you are using .EXE in your app path.   Based on comments in this thread I think there's another bug that people are hitting and I don't have a status update on that yet.

yodurr avatar Feb 02 '17 23:02 yodurr

@tylerrrrrr do you have a lot of other applications running, are there a lot of other windows up?  That can slow down WinAppDriver's ability to find the Windows you're looking for.

Also especially since you're doing multiple session creation in your test it would help me set up a repro if I can see more of your test code.

yodurr avatar Feb 08 '17 18:02 yodurr

@yodurr I have my Windows Modern app, WinAppDriver, a file explorer, a running batch file, and 2 instances of Powerpoint(since my app launches it, and WAD launches a new instance of it. Have not found a way to hook into an already existing instance of an app).

What the basic flow is:

  1. Launch and Interacting with my WM app(calculator for example) DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "MyApp"); generalDriver = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);
  2. Click powerpoint within my app which launches ppt
  3. Create new driver for ppt DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("app", "C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\POWERPNT.exe"); generalDriver = new IOSDriver(new URL("http://127.0.0.1:4723"), capabilities);
  4. Attempt to verify ppt opened(error here)

I'm using the same WAD instance, and I have also tried using 2 instances with the same result.

tylerrrrrr avatar Feb 08 '17 19:02 tylerrrrrr

@tylerrrrrr I think after #2 you should instead do the following for #3 to create a test session with the powerpoint window your app launched. I tried this and it found the Powerpoint Window and got a screen shot of it.

// Create Desktop session to find powerpoint window launched by your app DesiredCapabilities desktopCapabilities = new DesiredCapabilities(); desktopCapabilities.SetCapability("app", "Root"); desktopCapabilities.SetCapability("deviceName", "WindowsPC"); WindowsDriver<WindowsElement> DesktopSession = new WindowsDriver<WindowsElement>(new Uri(AppDriverUrl), desktopCapabilities); Assert.IsNotNull(DesktopSession);

// Find powerpoint window WindowsElement we = DesktopSession.FindElementByName("Presentation1 - PowerPoint"); // Take a screenshot of it Screenshot we2 = we.GetScreenshot(); we2.SaveAsFile("c:\\temp\\ppt.jpg", System.Drawing.Imaging.ImageFormat.Jpeg);

yodurr avatar Feb 14 '17 08:02 yodurr

@yodurr I started getting same error in one of my build machines.

{"status":13,"value":{"error":"unknown error","message":"An unknown error occurred in the remote end while processing the command."}}

You mentioned on February 3rd that you'll try to get a fix for next release, is that already available? Is that fix for winappdriver.exe?

JanneRantala avatar Mar 22 '17 09:03 JanneRantala

First time using Appium for windows and such a bummer to immediately run into this issue. So I am able to start my app which opens up showing a login window. It then immediately errors out with error in this thread.

========================================== POST /session HTTP/1.1 Accept: application/json, image/png Connection: Keep-Alive Content-Length: 145 Content-Type: application/json;charset=utf-8 Host: 127.0.0.1:4723

{"desiredCapabilities":{"deviceName":"WindowsPC","app":"C:\Program Files\Symed\OneAppPro\Symed.Framework.Stub.exe","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."}}

eddiekorbz avatar Apr 05 '17 17:04 eddiekorbz

Here is my code: using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium.Appium.Windows; using OpenQA.Selenium.Remote;

namespace ThickClient { [TestClass] public class OneAppBase { protected const string AppDriverUrl = "http://127.0.0.1:4723"; protected static WindowsDriver OneAppSession;

    //protected const string PasswordValue = "password";
    [ClassInitialize] 
    public static void OneAppBaseSetup(TestContext testcontext)
    {
        if (OneAppSession == null)
        {
            //launch the Notepad app 
            DesiredCapabilities appCapabilities = new DesiredCapabilities();

            appCapabilities.SetCapability("deviceName", "WindowsPC");
            appCapabilities.SetCapability("app", @"C:\Program Files\Symed\OneAppPro\Symed.Framework.Stub.exe");
            OneAppSession = new WindowsDriver<WindowsElement>(new Uri(AppDriverUrl), appCapabilities);
            Assert.IsNotNull(OneAppSession);

        }
    }

    [TestMethod]
    public void Login()
    {
        //Login to OneApp
        OneAppSession.FindElementByName("Password:").SendKeys("password");
        Assert.IsNotNull(OneAppSession);

    }

    //[ClassCleanup] 
    //public static void NotepadBaseTearDown()
    //{
    //    if (OneAppSession != null) 
    //    { 
    //         OneAppSession.Dispose(); 
    //         OneAppSession = null; 
    //    } 
    //} 

}

}

eddiekorbz avatar Apr 05 '17 17:04 eddiekorbz