Wednesday, February 16, 2011

Accepting Untrusted Certificates - Https Webdriver firefox

Code for resolving https issue :
1. Create a firefox new profile
Refer http://kb.mozillazine.org/Creating_a_new_Firefox_profile_on_Windows

Open firefox , open your application and accept the cerificate manually.
Now add below code in your script (assuming the newly created profile name is WebDriver2).

ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("WebDriver2");
profile.setAcceptUntrustedCertificates(false);
WebDriver driver = new FirefoxDriver(profile);


No comments: