13

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 my console application it fires up internet explore and runs through all the tests that I have created using WatiN.

What I want is for my console application to run through these tests using WatiN, but without displaying Internet Explorer starting up and appearing on the screen.

I basically want the tests to run without seeing Internet Explorer.

Tomalak
  • 332,285
  • 67
  • 532
  • 628

3 Answers3

25

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;
M Ward
  • 301
  • 3
  • 5
5

Try:

using (IE ie = new IE("http://somesite.com/"))
{
  ie.ShowWindow(NativeMethods.WindowShowStyle.Hide);
  ....
}
Mark
  • 106,305
  • 20
  • 172
  • 230
1
browser.ShowWindow(WatiN.Core.Native.Windows.NativeMethods.WindowShowStyle.Hide); 
Para
  • 2,022
  • 5
  • 34
  • 73