Skip to content

Bad Request message when running winappdriver remotely on C# #2064

@billytim22

Description

@billytim22

Just recently discovered an issue running WinAppDriver remotely on C#. Getting the following Bad Request error below.

Unhandled exception. OpenQA.Selenium.WebDriverException: Unexpected error. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN""http://www.w3.org/TR/html4/strict.dtd">
<HTML><HEAD><TITLE>Bad Request</TITLE>
<META HTTP-EQUIV="Content-Type" Content="text/html; charset=us-ascii"></HEAD>
<BODY><h2>Bad Request - Invalid Hostname</h2>
<hr><p>HTTP Error 400. The request hostname is invalid.</p>
</BODY></HTML>

Code worked fine weeks ago so I'm not sure what the issue is. I'm able to run it just fine locally. Here is the code.

Test Runner

``winappdriver.exe '10.X.3.0 4723/wd/hub/'
This works and is listening.

Test Machine

        public static void Main(String[] args)
        {
            // Launch Calculator application if it is not yet launched
            if (session == null)
            {
                AppiumOptions driver = new();
                driver.AddAdditionalCapability("app", CalculatorAppId);
                driver.AddAdditionalCapability("deviceName", "WindowsPC");

               session = new WindowsDriver<WindowsElement>(new Uri("http://10.X.3.0:4723/wd/hub/"), driver);
                session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
            }
        }

Using Selenium - 3.141.0
Appium - 4.4.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions