private void InitializeApplication() { var appPath = this.Automator.ActualCapabilities.App; var appArguments = this.Automator.ActualCapabilities.Arguments; var debugDoNotDeploy = this.Automator.ActualCapabilities.DebugConnectToRunningApp; var processName = this.Automator.ActualCapabilities.ProcessName; var launchDelay = this.Automator.ActualCapabilities.LaunchDelay; if (processName.Length == 0) { DriverManager.StartApp(appPath, appArguments, debugDoNotDeploy); Thread.Sleep(launchDelay); } else { if (!debugDoNotDeploy) { DriverManager.CloseDriver(); DriverManager.CloseAllApplication(processName); } try { DriverManager.StartApp(appPath, appArguments, debugDoNotDeploy); } catch { } Thread.Sleep(launchDelay); DriverManager.AttachToProcess(processName); } }
protected override string DoImpl() { if (!this.Automator.ActualCapabilities.DebugConnectToRunningApp) { DriverManager.CloseDriver(this.Automator.ActualCapabilities.App.StartsWith("#")); this.Automator.ElementsRegistry.Clear(); } return(this.JsonResponse()); }
public void Event() { ChromeOptions op = new ChromeOptions(); op.EnableMobileEmulation("Apple iPhone 4"); //DriverFactory.Instance.DriverOption = op; DriverManager.StartDriver(Browser.ChromeDesktop); IWebDriver driver = DriverManager.GetDriver <IWebDriver>(); driver.Url = "https://www.whatismybrowser.com/"; IWebElement el = driver.FindElement(By.XPath("//*[@id='holder']//*[@class='detection-primary content-block']")); WebKeywords.Instance.GetScreenShot(); Utilities.Instance.GetWebElementBaseImage(el, formatType: System.Drawing.Imaging.ImageFormat.Jpeg); driver.Dispose(); DriverManager.CloseDriver(); }
public void Finish() { try { var webKeyWords = Resolve <IWebKeyWords>(); webKeyWords.GetScreenShot(); } catch (Exception e) { Console.WriteLine("Ocorreu um erro ao capturar o Screenshot :("); throw new Exception(e.Message); } finally { DriverManager.CloseDriver(); } }
public void CloseDriver() { try { var status = CurrentContext.Result.Outcome.Status; var stacktrace = CurrentContext.Result.StackTrace; var errorMessage = CurrentContext.Result.Message; var screenShot = Capture($"{CurrentContext.Test.ClassName}_{CurrentContext.Test.ID}"); Status logStatus; string message = $"Test ended with "; switch (status) { case TestStatus.Failed: logStatus = Status.Fail; message += $"{logStatus} - {errorMessage}"; childTest.Log(logStatus, $"Test ended with {logStatus} - {errorMessage}"); break; case TestStatus.Skipped: logStatus = Status.Skip; message += $"{logStatus}"; break; default: logStatus = Status.Pass; message += $"{logStatus} "; break; } childTest.Log(logStatus, message, screenShot); // remove data DataSetUpHelper helper = new DataSetUpHelper(ValidCredentials.Username, ValidCredentials.Password); foreach (var obj in _setUpContext.GetObejcts()) { helper.Delete(obj); } } catch (Exception) { throw; } finally { DriverManager.CloseDriver(); } }
public void TearDown() { DriverManager.CloseDriver(); NodeFactory.Instance.CloseNodeServer(); }
public void TearDown() { DriverManager.CloseDriver(); }
public void QuitDriver() { DriverManager.CloseDriver(); }
public void TestCleanup() { driver.Manage().Cookies.DeleteAllCookies(); driver = DriverManager.CloseDriver(); }
public void cleanUp() { Console.WriteLine("Stop run test...."); DriverManager.CloseDriver(); }
public void KillDriver() { DriverManager.CloseDriver(); DriverManager = null; }
public void Cleanup() { DriverManager.CloseDriver(); }
/// <summary> /// Custom on after test configuration method for Dynamo application. /// </summary> protected override void OnAfterTest() { DriverManager.CloseDriver(); }
public void Dispose() { _driver.Close(); _driver.Dispose(); DriverManager.CloseDriver(); }