WatiN BrowserNotFoundException after upgrading to IE9

不问归期 提交于 2019-12-11 07:35:57

问题


I just upgraded my x64 Windows 7 machine to IE9 and now WatiN is throwing a BrowserNotFoundException when I do something like:

IE ie = new IE(true);
ie.GoTo("http://google.com");

I am using WatiN 2.1 and the latest code from SourceForge. The exact version of IE9 I'm running is 9.0.5. The browser window actually launches to "about:blank" but WatiN fails to find the newly launched browser. It appears WatiN finds the newly launched browser by comparing the main window handle of the launched iexplore.exe process to the main window handle of the browsers it finds using the native COM methods.

Is there any special setup I need to do with IE 9 to make it work with WatiN? I've tried changing WatiN to launch without add-ons and that didn't work either. Any ideas are greatly appreciated.


回答1:


I had a similar issue a little while back and was able to solve it by changing my IE9 settings. The main things I find that tend to break WatiN are compatibility mode and protected mode. Turn these off. For Protected mode you have to turn it off for each security level. Not sure if this is the issue but thought I should mention it just in case!




回答2:


I've got no idea since I've got the same configuration and everything is working ok here, but what happens when you put a System.Threading.Thread.Sleep(5000); between the two lines? Is there any difference if you run the test through NUnit? What happens when you start the browser with IE ie = new IE("http://google.com"); Can you load the example from here and try to run the included example - \example\watin?



来源:https://stackoverflow.com/questions/9999480/watin-browsernotfoundexception-after-upgrading-to-ie9

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!