0 votes
1 view
in Devops and Agile by (23.1k points)

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

enter image description here

Please help me to overcome from this issue. 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");

1 Answer

0 votes
by (58.7k points)

To me, the most simple and efficient 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 looked into the available constructors and came up with the above code.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...