Search code examples
c#browsercontrolswatinembedded-browser

watin attachto Embedded browser


I have a c# windows form project using watin.

I would love to attach to the web-browser control on a form, is this possible? Is there any sample code on how to attach to the embedded web-browser control.

//Looks like this only works for actual IExplorer instances.
window = WatiN.Core.Browser.AttachTo<WatiN.Core.IE>(WatiN.Core.Find.ByTitle("Google"));

Solution

  • This is code I used to attach to the Embeded Web Browser Control:

    WatiN.Core.IE window = null;
    WatiN.Core.Settings.AutoStartDialogWatcher = false;
    window = new WatiN.Core.IE(webBrowser1.ActiveXInstance);