如何通过 Watin 中的代码关闭弹出窗口拦截器?
我在通过 watin 代码关闭弹出窗口阻止程序时遇到麻烦。 谁能帮我知道如何通过 watin 关闭 IE 的弹出窗口拦截器? 如果 IE 中安装了工具栏(如 google、yahoo 或 msn)的弹出窗口拦截器,有什么方法可以关闭它们吗? 提前感谢您的帮助。
I am facing trouble in turning the popup blocker off through watin code. Could anyone please help me in knowing how to turn off the popup blocker of IE through watin? Is there any way to turn off the popup blocker of tool bars (like google, yahoo or msn) if any of them are installed in IE? Thanks for your help in advance.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以使用 .NET 更改 IE 的注册表项。 有关特定的详细信息,请参阅 http://support.microsoft.com/kb/843016键。
全部:
每个区域:
每个站点:
下面是通过 .NET 编写注册表项以将站点置于受信任区域的代码示例,这使得 WatiN 能够下载文件:
以编程方式将可信站点添加到 Internet Explorer
You can use .NET to change the registry keys for IE. See http://support.microsoft.com/kb/843016 for more information on the specific keys.
All:
Per Zone:
Per Site:
Here is a code example of writing the registry keys through .NET to get a site into a trusted zone, which allowed WatiN to be able to download a file:
Programmatically add trusted sites to Internet Explorer
您无法使用 WatiN 禁用此功能,但是您可以使用 UIAutomation 来执行此操作。
You can't disable this with WatiN, you could however use UIAutomation to do it.