运行WatiN时隐藏Internet Explorer [英] Hiding Internet Explorer when WatiN is run
问题描述
我想知道每次运行使用WatiN测试实时网站的控制台应用程序时,如何阻止Internet Explorer启动。
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.
当我运行时我的控制台应用程序启动Internet探索并运行我使用WatiN创建的所有测试。
When I run my console application it fires up internet explore and runs through all the tests that I have created using WatiN.
我想要的是我的控制台应用程序使用WatiN运行这些测试,但没有显示Internet Explorer启动并出现在屏幕上。
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.
我基本上希望测试在没有看到Internet Explorer的情况下运行。
I basically want the tests to run without seeing Internet Explorer.
推荐答案
deafult的IE类使用一些内置设置来实现一些功能。其中一个是MakeNewIeInstanveVisible。默认情况下,它设置为true。因此,您可以在创建IE类的新实例之前更改WatiN设置。
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;
这篇关于运行WatiN时隐藏Internet Explorer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!