Watin - how I can do the testing on different versions of Internet Explorer?
I need to do tests on different versions of Internet Explo开发者_Go百科rer browser, but not WATIN.CORE.IE a method that would alter the version of browser used. I hope you understand my problem.
You will need multiple virtual machines each installed with a different version of ie because you cannot install ie versions side by side (There are a few hacks but you never get a true representation).
You can query the registry to get the IE version.
To output the full version number to the NUnit console do the following.
var ieKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SOFTWARE\Microsoft\Internet Explorer");
if (ieKey == null)
{
Console.WriteLine("IE key not found");
}
else
{
Console.WriteLine("Version:" + (string)ieKey.GetValue("Version"));
}
The above was verified using: Windows 7, IE8 and WatiN 2.0
Thanks be to Jeroen as the registry call is copied verbatim out of IE.cs
精彩评论