I want to run some automated browser tests on my ASP.NET Core 2.1 web application. For this application, I have HttpsRedirection enabled, and I ran the command dotnet dev-certs https --trust
to trust the ssl certificates used by ASP.NET Core.
I have downloaded the firefox selenium driver and added the executable to my PATH. This works as a firefox window is opened when I run the code.
Accepting the risk and continuing does nothing as the code has already disconnected from the browser.
var firefoxOptions = new FirefoxOptions();
var profile = new FirefoxProfile();
profile.AcceptUntrustedCertificates = true;
// Tried the following, got this: Invalid moz:firefoxOptions field acceptInsecureCerts
// firefoxOptions.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true);
firefoxOptions.Profile = profile;
var driver = new FirefoxDriver(firefoxOptions);
driver.Url = "http://localhost:5002/";
I expect to be taken to my web app, as happens when I browse to http://localhost:5002
in firefox myself. Instead, I get the following: