How to deal with the error "Your connection is unsafe" in firefox using selenium

I am using webdriver V 3.0.1 and firefox V 46. I encountered an error: "Your connection is not secure."

enter image description here

Please help me overcome this problem. Below you can find my code

System.setProperty("webdriver.gecko.driver","D:\\Software\\Webdriver\\gecko new\\geckodriver-v0.11.1-win64\\geckodriver.exe"); FirefoxProfile profile = new FirefoxProfile(); profile.setPreference("network.proxy.type", 0); profile.setAcceptUntrustedCertificates(true); profile.setAssumeUntrustedCertificateIssuer(false); WebDriver driver = new FirefoxDriver(profile); driver.get("http://qa.applications.marykayintouch.com/Login/Login.aspx"); 
+7
java firefox selenium webdriver
source share
4 answers

SSLC seems to be checking for error Just try with editing options

 ProfilesIni profiles = new ProfilesIni(); System.setProperty("webdriver.firefox.profile","custom firefox profile name"); String browser_profile = System.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = profiles.getProfile(browser_profile); profile.setAcceptUntrustedCertificates (true); webdriver = new FirefoxDriver(profile); 

or

 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); driver = new FirefoxDriver(capabilities); 

or

 DesiredCapabilities capabilities = new DesiredCapabilities(); ProfilesIni profiles = new ProfilesIni(); System.setProperty("webdriver.firefox.profile","custom firefox profile name"); String browser_profile = System.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = profiles.getProfile(browser_profile); profile.setAcceptUntrustedCertificates(true); capabilities.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true); capabilities.setCapability(FirefoxDriver.PROFILE, profile); webdriver = new FirefoxDriver(capabilities); 

Hope this works.

0
source share

To handle the SSL certificate error in Firefox, we need to use the desired features of Selenium Webdriver and follow these steps:

 ProfilesIni allProfiles = new ProfilesIni(); System.setProperty("webdriver.firefox.profile","your custom firefox profile name"); String browserProfile = stem.getProperty("webdriver.firefox.profile"); FirefoxProfile profile = allProfiles.getProfile(browserProfile); profile.setAcceptUntrustedCertificates (true); webdriver = new FirefoxDriver(profile); 

You can reference the following information: Processing UntrustedSSLcertificates with WebDriver

0
source share

You get an error because the processing of SSL certificates. please refer to this link http://learn-automation.com/handle-untrusted-certificate-selenium/

0
source share

For me, the easiest and most effective solution was to do this.

 var options = new FirefoxOptions() { AcceptInsecureCertificates = true }; using (var driver = new FirefoxDriver(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), options)) { // Your code } 

I tried using the Sanjay Bhimani example, but it didn’t work, so I looked at the available constructors and ended up with the code above.

0
source share

All Articles