Handling UntrustedSSLcertificates using WebDriver

前端 未结 2 2027
别那么骄傲
别那么骄傲 2020-12-01 22:36

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

I created firefox profile like:

FirefoxProfile profile = new FirefoxProfil         


        
相关标签:
2条回答
  • 2020-12-01 23:12

    //Firefox example with URL www.google.com

    FirefoxProfile profile=new FirefoxProfile();
    
    profile.setAssumeUntrustedCertificateIssuer(false);
    
    driver=new FireforDriver(profile);
    
    driver.get("https://google.com");
    
    0 讨论(0)
  • 2020-12-01 23:20

    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 讨论(0)
提交回复
热议问题