views:

392

answers:

2

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.

+1  A: 

Try:

using (IE ie = new IE("http://somesite.com/"))
{
  ie.ShowWindow(NativeMethods.WindowShowStyle.Hide);
  ....
}
Mark
+5  A: 

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