private void Main_FormClosed(object sender, FormClosedEventArgs e) { if (_browser != null) { _browser.Dispose(); _browser = null; } }
public void CallingIEDisposeAfterIECloseShouldNotThrowAnExeption() { var ie = new IE(); ie.Close(); ie.Dispose(); }
/// <summary> /// Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. /// </summary> public void Dispose() { if (browser != null) { browser.Dispose(); } }
static void Test2(IE ie) { ie.doom(); object o = ie.Clone(); ie.Dispose(); }
public void TearDown() { if (browser != null) { browser.Dispose(); } }
public virtual void TearDown() { if (browser != null) { browser.Dispose(); browser = null; } }
public void TearDownTest() { browser.ClearCookies(rootUrl); browser.ClearCache(); browser.Close(); browser.Dispose(); browser = null; }
void Close() { ie.ClearCache(); ie.ClearCookies(); ie.Close(); ie.Dispose(); complete(); }
private void Start(ref Exception exception, ref string output, string term) { IE browser = null; try { browser = IEBrowserHelper.GetBrowser(); browser.GoTo("https://www.google.com.br/"); browser.WaitForComplete(); TextField txtSearch = browser.TextField(Find.ByName("q")); if (txtSearch.Exists) { txtSearch.SetAttributeValue("value", term); } Element btnFind = browser.Element(Find.ByName("btnK")); if (btnFind.Exists) { btnFind.Click(); } var resultadosComplementares = browser.Div(Find.ByClass(p => p.Contains("kno-ecr-pt kno-fb-ctx"))); if (resultadosComplementares.Exists) { output = resultadosComplementares.OuterText; var resultadosComplementaresDescricao = browser.Div(Find.ByClass(p => p.Contains("kno-rdesc"))); if (resultadosComplementaresDescricao.Exists) { output += ": " + resultadosComplementaresDescricao.Spans[0].OuterText.Replace("\r\n", string.Empty); } } else { output = "O termo de busca não resultou em algo com a area de Resultados complementares"; } } catch (Exception e) { exception = e; } finally { //Close the browser if (browser != null) { browser.Close(); browser.Dispose(); } } }
public void DoTestTeardown() { if (ie != null) { ie.Close(); ie.Dispose(); ie = null; } }
public void DisposeBrowser() { if (TestContext.CurrentContext.Outcome.Status == TestStatus.Failed) { TestHelper.Snapshot(Ie, "Final screen when failure occurred.", TestLog.Failures); } if (Ie != null) { Ie.Dispose(); } }
public void DoTestTeardown() { if (ie != null) { if (TestContext.CurrentContext.Outcome == TestOutcome.Failed) { ie.CaptureWebPageToFile(@"C:\Documents and Settings\All Users\Favorites.png"); } ie.Close(); ie.Dispose(); ie = null; } }
public void Start() { const string host = "arcanemastermind"; var url = $"http://crawl.akrasiac.org:8080/#watch-{host}"; var thread = new Thread(() => { var ie = new IE(url) { Visible = false, AutoClose = true }; while (true) { var enteredKeys = Console.ReadLine(); if (enteredKeys == "register") { var registerCommand = Command.Register; registerCommand.CommandParams["username"] = Console.ReadLine(); registerCommand.CommandParams["password"] = Console.ReadLine(); registerCommand.CommandParams["email"] = Console.ReadLine(); var registerScript = registerCommand.ToString(); ie.RunScript(registerScript); } else if (enteredKeys == "login") { var loginCommand = Command.Login; loginCommand.CommandParams["username"] = Console.ReadLine(); loginCommand.CommandParams["password"] = Console.ReadLine(); var loginScript = loginCommand.ToString(); ie.RunScript(loginScript); } else if (enteredKeys == "send") { var sendMessage = Command.SendMessage; sendMessage.CommandParams["text"] = Console.ReadLine(); var sendScript = sendMessage.ToString(); ie.RunScript(sendScript); } else if (enteredKeys == "exit") { ie.Dispose(); break; } } }); thread.SetApartmentState(ApartmentState.STA); thread.Start(); }
static void Main(string[] args) { IE ie = new IE("http://192.168.0.1/pppoestatus.htm"); LogonDialogHandler dhdlLogon = new LogonDialogHandler("admin", "password"); ie.AddDialogHandler(dhdlLogon); ie.GoTo("http://192.168.0.1/pppoestatus.htm"); Console.WriteLine("Desconecto..."); ie.Button(Find.ByValue(" Disconnect ")).Click(); Thread.Sleep(10000); //ie.GoTo("http://192.168.0.1/pppoestatus.htm"); Console.WriteLine("Conecto..."); ie.Button(Find.ByValue(" Connect ")).Click(); ie.Dispose(); }
void Close() { try { //ie.ClearCache(); } catch { } try { //ie.ClearCookies(); } catch { } try { ie.Close(); } catch { } try { ie.Dispose(); } catch { } }
public void Dispose() { _browser.Dispose(); }
public void ScenarioCleanup() { Browser.Dispose(); }
internal void Kill() { ie.Close(); ie.Dispose(); ie = null; }
static void Test2(IE ie) { ie.doom (); ie.Clone(); ie.Dispose (); }
public void CallingIEDisposeAfterIECloseShouldNotThrowAnExeption() { var ie = new IE(); ie.Close(); ie.Dispose(); }
public void Dispose() { _ie.Close(); _ie.Dispose(); }
private void TDB_FormClosed(object sender, FormClosedEventArgs e) { browser.Dispose(); }
public void logout() { ie.Close(); ie.Dispose(); }
public static void CleanupBrowser() { _browser = null; _ie.Dispose(); _ie = null; }
public void Dispose() { IE.Dispose(); IE = null; }
public void TearDown() { ie.Dispose(); }
private void MainForm_FormClosed(object sender, System.Windows.Forms.FormClosedEventArgs e) { _browser = null; _ie.Dispose(); _ie = null; }
public virtual void Dispose() { IE.Dispose(); IE = null; }
private void Form1_FormClosing(object sender, FormClosingEventArgs e) { try { browser.Dispose(); browser.ForceClose(); } catch { } }
public void Teardown() { _ie.Dispose(); }