I've scoured the internet (including answers from this site) but nothing appears to work for me. Does anyone know the correct approach to attach WatiN to a WebBrowser instance (Windows Presentation Forms version)?
Most of the answers I've read tell me about 'ActiveXInstance', which is not visible in the WPF version of WebBrowser. I've tried exposing the IWebBrowser 2 interface from the WebBrowser documentation (http://msdn.microsoft.com/en-us/library/cc491073%28v=VS.90%29.aspx) but after much reworking of the code structure to get it to compile, a simple WatiN goto(URL statement simply ends up timing out.
As a last resort I've tried
WatiN.Core.Settings.AutoStartDialogWatcher = false;
var browser = new IE(wbrowser);
On the loadcompleted event (as the browser instance will result in null if I place it in the MainWindow() constructor method), but that brings up an Argument Exception with the message "iwebBrowser2 needs to implement shdocvw.IWebBrowser2". Unfortunately I've no idea how to resolve this.