简体   繁体   中英

c# selenium hide Internet Explorer browser window

I'm using selenium with c# and I would like to hide the internet explorer browser window. As far as I understood IE does not support headless browser.

For the particular case I'm working on, IE is the fastest browser, since I'm accessing internal company webpage.

Can you help me out?

I had the same problem and I'm happy to help you out. I am still looking for a solution to start IE headless but with the minimized version I could also help myself.

here an idea:

IWebDriver webDriver;

public void StackTest()
{
   webDriver = new InternetExplorerDriver();
   webDriver.Manage().Window.Minimize();
}

as a little tip I recommend to keep IE waiting until everything is loaded:

webDriver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(60);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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