user2919960
user2919960

Reputation: 81

Selenium C# The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed

" Message=A exception with a null response was thrown sending an HTTP request to the remote WebDriver server for URL http://localhost:49803/session. The status of the exception was ReceiveFailure, and the message was: The underlying connection was closed: An unexpected error occurred on a receive."

So I have a handful of tests which work with Chrome. I am testing out on Edge (for now, the rest of the browsers later).

The method I am running which is failing is: public void Load(string Url, Browsers Browser) { this.Url = Url; this.Browser = Browser;

        IWebDriver driver;

        switch (Browser)
        {
            case Browsers.Edge:
                driver = new EdgeDriver(driverLocation);
                driver.Manage().Window.Maximize();
                break;
            case Browsers.Chrome:
                ChromeOptions options = new ChromeOptions();
                options.AddArgument("--start-maximized");
                driver = new ChromeDriver(driverLocation, options);
                break;
            case Browsers.Firefox:
                driver = new FirefoxDriver(driverLocation);
                driver.Manage().Window.Maximize();
                break;
            default:
                driver = new ChromeDriver(driverLocation);
                break;

        }
        driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(15);
        Driver = driver;
        driver.Url = this.Url;
    }

Where the browser passed in is edge.

                driver = new EdgeDriver(driverLocation);
                driver.Manage().Window.Maximize();
                break;

The browser loads, then I receive the error above.

I have checked my OS build (17763.437) and downloaded the latest WebDriver (Release 17134) cuz that is all there is. I see no info on Edge specific stuff I need. My search foo is pathetic however.

Help lease

Upvotes: 2

Views: 604

Answers (1)

JimEvans
JimEvans

Reputation: 27486

The driver for Edge version 18, which shipped with Windows 10 build 17763, became a "feature on demand" for Windows, and is not generally downloadable as a separate download on the web. See the "Installation and Usage" section on the Microsoft WebDriver documentation page for information on how to install and use it.

Upvotes: 1

Related Questions