Firefox Error: “Your connection is not secure” while launching driver with Selenium 3.0.1 using Java

0
0

My Firefox version is 46.0.1 and Selenium version is 3.0.1.
I am getting error:

Your connection is not secure

while executing 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 have created new firefox profile and followed steps from this url

Nevertheless it’s not working and giving me same error while I launching any site.

  • You must to post comments
0
0

I have tried this approach and it worked well for me.

Create new firefox profile by following below step.

  1. Close all your firefox windows
  2. In the Run dialog box, type in: ‘firefox.exe -p’ and then Click OK.
  3. Click “Create Profile”
  4. Create a name for your new profile(say Selenium)
  5. Click “Choose Folder”
  6. Pick location something easy to find — like “C:\NewFirefoxProfile”
  7. Click Finish
  8. Now after selecting newly created profile, start Firefox. Open the specific url you were getting ‘Secure Connection Issue’, accept SSL certificates for this profile.

enter image description here

Now use the newly created firefox profile to run your selenium test. Modify below code 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/");
  • You must to post comments
Showing 1 result
Your Answer
Post as a guest by filling out the fields below or if you already have an account.
Name*
E-mail*
Website