1

I have upgraded Selenium and Firefox to the latest but the website I am testing now lands on the "Your connection is not secure" page and I can't get any of the suggestions online to work such as...

FirefoxOpts.SetPreference("webdriver_assume_untrusted_issuer", true);
FirefoxOpts.SetPreference("webdriver_accept_untrusted_certs", true);
FirefoxOpts.AddAdditionalCapability("acceptSslCerts", true);
FirefoxOpts.AddAdditionalCapability("acceptInsecureCerts", true); 

I have also tried creating a profile and using...

FirefoxProfile profile = profileManager.GetProfile("Selenium");
profile.SetPreference("webdriver.firefox.profile", "Selenium");

...but these don't work either. This is using Selenium Grid.

UPDATE

Code block for webdriver initiation is:

 var capabilities = new DesiredCapabilities();
 var FirefoxOpts = new FirefoxOptions();
 var profileManager = new FirefoxProfileManager();
 var profile = profileManager.GetProfile("Selenium");
 //profile.SetPreference("webdriver.firefox.profile", "Selenium");
 //profile.AcceptUntrustedCertificates = true;
 //profile.AssumeUntrustedCertificateIssuer = true;

 //profile.AcceptUntrustedCertificates = true;
 //profile.AssumeUntrustedCertificateIssuer = true;

 //capabilities.SetCapability(CapabilityType.AcceptSslCertificates, true);

 //FirefoxOpts.AddAdditionalCapability(CapabilityType.AcceptSslCertificates, true);

 FirefoxOpts.BrowserExecutableLocation = @"C:\Program Files\Mozilla Firefox\firefox.exe";
 FirefoxOpts.SetPreference("intl.accept_languages", "en-GB");
 FirefoxOpts.SetPreference("layout.css.devPixelsPerPx", "0.8");

 FirefoxOpts.Profile = profile;
 FirefoxOpts.ToCapabilities();

 //FirefoxOpts.SetPreference("webdriver_assume_untrusted_issuer", true);

 //FirefoxOpts.SetPreference("webdriver_accept_untrusted_certs", true);

 //FirefoxOpts.AddAdditionalCapability("acceptSslCerts", true);
 //FirefoxOpts.AddAdditionalCapability("acceptInsecureCerts", true);
 //FirefoxOpts.AddAdditionalCapability(CapabilityType.AcceptInsecureCertificates, true);

 Driver = new RemoteWebDriver(new Uri("http://" + Config.VM + ":5566/wd/hub"), FirefoxOpts);

There's lots I've commented out which I've tried previously but nothing works regarding accepting the certs or launching Firefox with a specified profile

alex
  • 135
  • 3
  • 17

1 Answers1

0

This is most likely caused by your self signed dev certificate. I started having the same issues with chromedriver. The easiest fix was to add the certificate to the trusted root certificates.

  1. run MMC
  2. File->Add Snap-in
  3. Click certificates and add
  4. Go to local computer -> personal -> certificates
  5. Locate and highlight your certificate, right click it and copy
  6. Paste it into the Trusted Root Authority folder.

Firefox should be happy now.

Darth
  • 1,347
  • 1
  • 8
  • 6