Firefox error: "Your connection is not secure" when starting the driver with Selenium 3.0.1 using Java

My version of Firefox is 46.0.1, and the version of Selenium is 3.0.1. I get an error message:

Your connection is not safe

when executing the following code:

@Test public void test() { ProfilesIni profile = new ProfilesIni(); FirefoxProfile ffProfile = profile.getProfile("newCretedProfile"); ffProfile.setAcceptUntrustedCertificates(true); ffProfile.setAssumeUntrustedCertificateIssuer(false); System.setProperty("webdriver.gecko.driver", "D:\\SELENUIUM\\Drivers\\geckodriver.exe"); FirefoxDriver driver = new FirefoxDriver(ffProfile); driver.get("http://www.google.com"); driver.quit(); } 

I created a new firefox profile and followed the following url steps

However, it does not work and gives me the same error when starting any site.

+2
source share
5 answers

I tried this approach and it worked well for me.

Create a new firefox profile by following the next step.

  • Close all firefox windows
  • In the Run dialog box, enter "firefox.exe -p" and click "OK."
  • Click Create Profile
  • Create a name for your new profile (e.g. Selenium).
  • Click Select Folder
  • Choose a location that is easy to find - for example, C: \ NewFirefoxProfile
  • Click Finish
  • Now, having chosen a new profile, start Firefox. Open the special URL that you received "Secure Connection Problem", accept SSL certificates for this profile.

enter image description here

Now use the newly created firefox profile to run the selenium test. Change the code below as per your requirement.

 System.setProperty("webdriver.firefox.marionette","D:\\SELENUIUM\\Drivers\\geckodriver.exe"); ProfilesIni profile = new ProfilesIni(); FirefoxProfile myprofile = profile.getProfile("C:\\NewFirefoxProfile");//location of your new firefox profile WebDriver driver = new FirefoxDriver(myprofile); driver.get("https://cacert.org/"); 
+2
source

With FF v53 + and Se 3.x (summer 2017), the tips from (May?) 2017 are no longer valid.

You must use Marionette and set it to True.

It took me a few days to sort out the old and outdated tips, for free. :-)

+2
source

Download the beta version of Firefox 55 and install

 capabilities.setCapability("acceptInsecureCerts", true); 

Here is my code that works for the beta version of Firefox 55:

 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setBrowserName("firefox"); capabilities.setCapability("acceptInsecureCerts", true); RemoteWebDriver driver = new RemoteWebDriver(Environment.remoteWebDriverURL, capabilities); 
+2
source

It looks like it is not yet supported by geckodriver / Marionette.

You can check below errors for more information: -

https://github.com/mozilla/geckodriver/issues/93

https://bugzilla.mozilla.org/show_bug.cgi?id=1103196

+1
source

If you want to run tests in Firefox using Selenium 3.0, set the Firefox driver "puppet" to false.

  @Test public void test() { DesiredCapabilities d = new DesiredCapabilities(); d.setCapability("marionette", false); WebDriver driver = new FirefoxDriver(d); driver.get("http://www.google.com"); driver.quit(); } 
0
source

Source: https://habr.com/ru/post/955564/


All Articles