// region close public static WatiN_IE close(this WatiN_IE watinIe) { "closing WatIN InternetExplorer Process".info(); watinIe.close(); //watinIe.Close(); return(watinIe); }
public static WatiN_IE closeInNSeconds(this WatiN_IE watinIe, int seconds) { if (seconds > 60) { "in WatiN_IE closeInNSeconds, provided value bigger than 60 secs, so changing the delay (before close) to 60".error(); seconds = 60; } "IE instance will be closed in {0} seconds".info(seconds); O2Thread.mtaThread( () => { watinIe.wait(5000); watinIe.close(); }); return(watinIe); }
public static WatiN_IE window(Form_Control control) { var webBrowser = control.add_Control <System.Windows.Forms.WebBrowser>(); var ie = new WatiN_IE(webBrowser); ie.HostControl = control; ie.setWebBrowserObject(webBrowser); var parentForm = control.parentForm(); if (parentForm.notNull()) { parentForm.Closed += (sender, e) => { "Parent form closed to detaching and close WatiN_IE".info(); ie.detach(); ie.close(); }; } return(ie); }