Hiding Internet Explorer when WatiN is run

后端 未结 3 2147
孤独总比滥情好
孤独总比滥情好 2020-12-09 05:27

I would like to know how I can prevent Internet Explorer from firing up every time I run my console application which uses WatiN for testing live sites.

When I run m

相关标签:
3条回答
  • 2020-12-09 05:33
    browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Hide); 
    
    0 讨论(0)
  • 2020-12-09 05:36

    Try:

    using (IE ie = new IE("http://somesite.com/"))
    {
      ie.ShowWindow(NativeMethods.WindowShowStyle.Hide);
      ....
    }
    
    0 讨论(0)
  • 2020-12-09 05:56

    The IE class by deafult uses some built in settings for a few features. One of which is MakeNewIeInstanveVisible. By default it is set to true. So you can change the WatiN Settings before you create a new instance of the IE class.

    Settings.Instance.MakeNewIeInstanceVisible = false;
    
    0 讨论(0)
提交回复
热议问题