开发者

Handling UntrustedSSLcertificates using WebDriver

开发者 https://www.devze.com 2023-03-04 18:15 出处:网络
I got stuck in handling UntrustedSSLcertificates using web driver in Java. I created firefox profile like:

I got stuck in handling UntrustedSSLcertificates using web driver in Java.

I created firefox profile like:

FirefoxProfile profile = new FirefoxProfile();
profile.setAcceptUntrustedCertificates(true);
profile.setAssumeUntrustedCertificateIssuer(false);

I created firefox profile, added over开发者_如何转开发ridden certificate.

This is not handling SSL certificates.

Is there any other way to handle UntrustedSSLcertificates?


//Firefox example with URL www.google.com

FirefoxProfile profile=new FirefoxProfile();

profile.setAssumeUntrustedCertificateIssuer(false);

driver=new FireforDriver(profile);

driver.get("https://google.com");


Eventually I found solution for Untrusted SSLCertificates:

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); 
0

精彩评论

暂无评论...
验证码 换一张
取 消