簡體   English   中英

啟動Internet Explorer時發生意外錯誤。 無法從窗口句柄(NoSuchDriver)獲取文檔

[英]Unexpected error launching Internet Explorer. Could not get document from window handle (NoSuchDriver)

我嘗試了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();

事實證明WinForms中的webBrowser控件畢竟滿足了我的所有需求

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM