【问题标题】:IE 11 with Selenium WebDriver: org.openqa.selenium.NoSuchWindowException带有 Selenium WebDriver 的 IE 11:org.openqa.selenium.NoSuchWindowException
【发布时间】:2015-10-20 09:22:19
【问题描述】:

我不知道为什么,如果我设置断点(见代码),它的工作(它做点击)但如果我只是运行我有一个异常 org.openqa.selenium.NoSuchWindowException 在线(JavascriptExecutor)。 ... 也许有人现在如何帮助我,或者有人知道如何忽略 IE 中的证书。 谢谢。

public class ie {
    public static void main(String[] args) throws InterruptedException {
        System.setProperty("webdriver.ie.driver", "drivers/iexploredriver.exe");

        DesiredCapabilities caps = DesiredCapabilities.internetExplorer();
        //caps.setCapability(InternetExplorerDriver.INTRODUCE_FLAKINESS_BY_IGNORING_SECURITY_DOMAINS, true);
        caps.setCapability(CapabilityType.ACCEPT_SSL_CERTS, true);
        WebDriver driver = new InternetExplorerDriver(caps); // there i setting break point
        driver.get("https://sasdka.test/uk/");
        ((JavascriptExecutor) driver).executeScript("document.getElementById('overridelink').click()");
        driver.quit();
    }
}

【问题讨论】:

    标签: java selenium selenium-webdriver internet-explorer-11


    【解决方案1】:
    Open Internet Options and switch to "Security" Tab
    Select the "Internet" Zone and Unselect the Checkbox "Enable Protected Mode".
    Apply this and do this for remaining 3 zones: 
     "Local intranet", "Trusted sites" and "Restricted sites".
    
    After this, close the Internet Options and Restart Internet Explorer to get these changes reflected.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-03-27
      • 1970-01-01
      • 2020-12-21
      • 1970-01-01
      • 2014-09-04
      • 2017-10-15
      • 2016-01-04
      相关资源
      最近更新 更多