views:

41

answers:

1

This question is more of a follow-up to this one: Hiding Internet Explorer when WatiN is run

Like the person who asked that original question, I also want to stop IE from being shown when my WatiN tests are running, but even when using this setting in a seemingly correct manner (code snippet below), it still ends up showing an empty IE window initially (although it does not show the test behavior/web page interaction).

Is it possible to stop the window from showing at all, or is this as good as it gets?

My helper method to create a new IE instance:

public static IE CreateNewBrowserInstance(string url = DefaultAppUrl)
    {
        Settings.Instance.MakeNewIeInstanceVisible = false;
        Settings.Instance.AutoMoveMousePointerToTopLeft = false;
        Settings.Instance.AutoStartDialogWatcher = false;

        return new IE(url, true);
    }
A: 

You can Hide window after initializing new IE instance

browser.ShowWindow(NativeMethods.WindowShowStyle.Hide);

alonp
My windows are already being hidden, but only after they pop up and annoy me. The docs suggest that your answer would just minimize the window, but I'll give it a try.
jrnail23
OK, I gave it a try, and it didn't do anything to help. I've got the same behavior as before.
jrnail23