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.
A:
You can't disable this with WatiN, you could however use UIAutomation to do it.
Bruce McLeod
2009-06-09 03:44:47
A:
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:
HKEY_LOCAL_MACHINE\Software\Microsoft\Internet Explorer\Main\FeatureControl\FEATURE_WEBOC_POPUPMANAGEMENT
Value = 0 for Off
Value = 1 for On
Per Zone:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\[0-4]\1809
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet Settings\Zones\[0-4]\1809
Value = 0 for Enabled
Value = 3 for Disabled
Per Site:
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\New Windows\Allow
Create subkey with domain name and binary data.
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:
http://stackoverflow.com/questions/972345/programmatically-add-trusted-sites-to-internet-explorer
Even Mien
2009-06-10 12:05:17