启动Internet Explorer时出现意外错误。无法从窗口句柄获取文档(NoSuchDriver)

问题描述 投票:0回答:1

我尝试了下面的代码100次仍然得到这个错误:

启动Internet Explorer时出现意外错误。无法从窗口句柄获取文档(NoSuchDriver)

除了没有价值的保护区同步之外,这个错误并不多。

InternetExplorerOptions options = new InternetExplorerOptions();
options.IntroduceInstabilityByIgnoringProtectedModeSettings = true;
IWebDriver driver = new InternetExplorerDriver(
    pathContainingIEDriverServer, options);

driver.Navigate().GoToUrl("http://www.google.com");

IWebElement searchTermTB = driver.FindElement(By.Name("q"));
searchTermTB.SendKeys("jimmy collins blog");

IWebElement searchBtn = driver.FindElement(By.Name("btnG"));
searchBtn.Click();

driver.Close();
c# selenium internet-explorer-10 ui-automation
1个回答
0
投票

毕竟,我所需要的WinForms中的webBrowser控件

© www.soinside.com 2019 - 2024. All rights reserved.