开发者

Problem hiding Internet Explorer in WatiN, even when using Settings.Instance.MakeNewIeInstanceVisible = false

开发者 https://www.devze.com 2023-01-04 04:22 出处:网络
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 te

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 cor开发者_C百科rect 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);
    }


You can Hide window after initializing new IE instance

browser.ShowWindow(NativeMethods.WindowShowStyle.Hide);

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号