Hi,
I have written one VSTS data driven test case. Where I need to update IE proxy setting for individual test cases. I have written following line of code to change proxy
RegistryKey reg = Registry.CurrentUser.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\Internet Settings\Connections", true);
string va = reg.GetValue("DefaultConnectionSettings").ToString();
reg.SetValue("DefaultConnectionSettings", @"hex:3c,00,00,00,15,00,00,00,01,00,00,00,0e,00,00,\00,31,32,37,2e,30,2e,30,2e,31,3a,38,30,38,30,09,00,00,00,6c,6f,63,61,6c,68,\6f,73,74,0b,00,00,00,31,31,31,2e,31,31,2e,31,31,31,31,01,00,00,00,00,00,00,\00,30,fd,35,de,8d,27,c6,01,03,00,00,00,c0,a8,01,73,c0,a8,b8,01,c0,a8,85,01,\00,00,00,00,00,00,00,00 ");
RegistryKey RegKey = Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Internet Settings", true);
RegKey.SetValue("ProxyServer", "proxyvalue");
RegKey.SetValue("ProxyEnable", 1);
It changes the proxy for first test case, but it does not change from 2nd test csaes.
Please help to identify what I'm doing wrong here.
Thanks, Pritam