Enabling AcceptInsecureCertificates in Selenium EdgeDriver options throws an exception

0

Setup is Windows 10 v1903 and Visual Studio 2019 v16.2.2

I've installed the EdgeDriver using the following command:

DISM.exe /Online /Add-Capability /CapabilityName:Microsoft.WebDriver~~~~0.0.1.0

I've then created a new .NET Core console app and added the latest Selenium.WebDriver NuGet package (v3.141.0) to it. Then I've added code to Program.cs so that it looks like this:

using OpenQA.Selenium.Edge;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            var edgeOptions = new EdgeOptions { AcceptInsecureCertificates = true };
            new EdgeDriver(edgeOptions);
        }
    }
}

When I run the console app I get the following error when executing the new EdgeDriver(edgeOptions); line.

OpenQA.Selenium.WebDriverException
  HResult=0x80131500
  Message=The specified arguments passed to the command are invalid.
  Source=WebDriver
  StackTrace:
   at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
   at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
   at OpenQA.Selenium.Remote.RemoteWebDriver.StartSession(ICapabilities desiredCapabilities)
   at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities)
   at ConsoleApp1.Program.Main(String[] args) in ********\Program.cs:line 10

However if I change the value of AcceptInsecureCertificates from true to false then I get no exception and the browser opens as expected. This feels like a bug but I don't know if it's Selenium or the EdgeDriver that's at fault.

selenium
selenium-webdriver
certificate
microsoft-edge
selenium-edgedriver
asked on Stack Overflow Aug 15, 2019 by Paul Hunt

1 Answer

1

From the Microsoft Edge WebDriver document, we can see that the W3C WebDriver is still not support at present.

enter image description here

You could submit the Feedback at the bottom of the WebDeiver document.

answered on Stack Overflow Aug 26, 2019 by Zhi Lv

User contributions licensed under CC BY-SA 3.0