![](/img/trans.png)
[英]Watin C# : How to hide “Internet Explorer is not your default browser”
[英]c# selenium hide Internet Explorer browser window
我在C#中使用硒,我想隱藏Internet Explorer瀏覽器窗口。 據我了解,IE不支持無頭瀏覽器。
對於我正在處理的特定情況,由於我正在訪問公司內部網頁,因此IE是最快的瀏覽器。
你能幫我嗎?
我遇到了同樣的問題,很高興為您提供幫助。 我仍在尋找無頭啟動IE的解決方案,但通過最小化版本,我也可以幫助自己。
這里有個主意:
IWebDriver webDriver;
public void StackTest()
{
webDriver = new InternetExplorerDriver();
webDriver.Manage().Window.Minimize();
}
作為一個小技巧,我建議讓IE等待直到一切加載完畢:
webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.