Skip to content

Getting HTTP 500 errors despite both servers running #2063

@cortosi

Description

@cortosi

I'm pretty new to Windows desktop automation and I'm stuck on what should be a basic setup.

Background & Context

I just started learning Windows desktop automation and discovered that WinAppDriver became obsolete starting with Appium 5.0.0. From what I understand, Appium now acts as a proxy toWinAppDriver, so both services need to be running simultaneously. This is where my problems begin.

Since both Appium and WinAppDriver try to use port 4723 by default, I'm running:

  • Appium Server: on port 4723 (default)
  • WinAppDriver: on port 4724 (to avoid conflicts)
namespace CalculatorTest
{
    public class CalculatorSession
    {
        private const string AppiumServerUrl = "http://127.0.0.1:4723/";
        private const string CalculatorID = "Microsoft.WindowsCalculator_8wekyb3d8bbwe!App";

        protected static WindowsDriver session;

        public static void Main()
        {
            AppiumOptions appiumOptions = new AppiumOptions
            {
                App = CalculatorID,
                PlatformName = "Windows",
                AutomationName = "Windows"
            };

            appiumOptions.AddAdditionalAppiumOption("appium:wadUrl", "http://127.0.0.1:4724");

            session = new WindowsDriver(new Uri(AppiumServerUrl), appiumOptions);

            Assert.IsNotNull(session);
            Assert.IsNotNull(session.SessionId);

            session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5);
        }
    }
}

The Problem - Two Different Errors

Error from my C# Application:

Unhandled Exception: OpenQA.Selenium.UnknownErrorException: An unknown server-side error occurred while processing the command. Original error: WinAppDriver server is not listening at http://127.0.0.1:4724. Make sure it is running and the provided wadUrl is correct
   at OpenQA.Selenium.WebDriver.UnpackAndThrowOnError(Response errorResponse, String commandToExecute)
   at OpenQA.Selenium.WebDriver.<ExecuteAsync>d__63.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at OpenQA.Selenium.WebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Appium.AppiumDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.WebDriver.StartSession(ICapabilities capabilities)
   at OpenQA.Selenium.WebDriver..ctor(ICommandExecutor executor, ICapabilities capabilities)
   at OpenQA.Selenium.Appium.AppiumDriver..ctor(Uri remoteAddress, ICapabilities appiumOptions)
   at OpenQA.Selenium.Appium.Windows.WindowsDriver..ctor(Uri remoteAddress, AppiumOptions AppiumOptions)
   at CalculatorTest.CalculatorSession.Main() in C:\Users\vitto\source\repos\ConsoleApp1\ConsoleApp1\Program.cs:line 26

C:\Users\vitto\source\repos\ConsoleApp1\ConsoleApp1\bin\Debug\ConsoleApp1.exe (process 127192) exited with code -532462766 (0xe0434352).

Error from WinAppDriver Console:

GET /status HTTP/1.1
Accept: application/json, /
Accept-Encoding: gzip, compress, deflate, br
Connection: keep-alive
Content-Type: application/json; charset=utf-8
Host: 127.0.0.1:4724
User-Agent: appium

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."}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions