繁体   English   中英

如何在 IE 11 中使用 Selenium webdriver 单击安全警告窗口?

[英]How to click on the Security Warning window using Selenium webdriver in IE 11?

安全警告窗口

当我单击“继续访问此网站(不推荐)”时,会弹出此图像。

请试试这个,它有效。

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()");
}

如果您可以通过绕过使用所需的凭据来禁用安全检查会更好,如果它与测试无关(节省时间),否则您需要使用像 auto-it 这样的第三方工具来自动化它。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM