2016-03-28 59 views

回答

0

如果您可以通過繞過使用所需的憑證來禁用安全檢查,如果它與測試無關(節省時間),則會更好,否則您需要使用第三方工具,例如自動將它自動化。

1

請嘗試這個,它的工作原理。

public void TestSSLerror() { 

    //Download IEDriver exe and past in project 
    driver = new FirefoxDriver(); 

    //Open WebSite for time being let's take http://test.com 
    driver.get("https://test.com"); 

    //now we are going to use javascipt ,This will click on "Continue to this website (not recommended)" text and will 
    //push us to the page 
    driver.navigate().to("javascript:document.getElementById('overridelink').click()"); 
} 
相關問題