/// <summary> /// Make sure the driver is shut down /// </summary> /// <param name="driver">The driver</param> public static void KillDriver(this AppiumDriver <IWebElement> driver) { try { driver?.Quit(); } finally { driver?.Dispose(); } }
public void DriverQuit(bool forceNoUninstall = false) { Thread.Sleep(1000); try { if (_deviceTarget.Platform == DevicePlatform.IOs) { if (IsBrowser(_packagePath)) { AppiumDriver.Close(); } else { AppInteraction.CloseApp(); } AppiumDriver.Dispose(); AppiumDriver.Quit(); } if (_deviceTarget.Platform == DevicePlatform.Android) { if (IsBrowser(_packagePath)) { AppiumDriver.Close(); } else { AppInteraction.CloseApp(); if (!String.IsNullOrEmpty(_installedPackageName) && UnInstallOnDriverQuit) { Console.WriteLine("Uninstall app : " + _installedPackageName); AppInteraction.RemoveApp(_installedPackageName); } else { Console.WriteLine("INFO : app not uninstalled !"); } } if (!forceNoUninstall) { AppiumDriver.Dispose(); } } } catch (Exception ex) { Console.WriteLine(ex.Message); } }
public void GetAndCloseDriverTest() { AppiumDriver <IWebElement> driver = AppiumDriverFactory.GetDefaultMobileDriver(); try { Assert.IsNotNull(driver); } finally { driver.Quit(); driver.Dispose(); } }
public void MobileDeviceTest() { AppiumDriver driver = AppiumDriverFactory.GetDefaultMobileDriver(); try { Assert.IsNotNull(driver); } finally { driver.Quit(); driver.Dispose(); } }
public void GetWaitDriverTest() { AppiumDriver <IWebElement> driver = AppiumDriverFactory.GetDefaultMobileDriver(); WebDriverWait wait = AppiumUtilities.GetDefaultWaitDriver(driver); try { Assert.IsNotNull(wait); } finally { driver.Quit(); driver.Dispose(); } }
public void MobileDeviceTest() { #region MobileDevice AppiumDriver <IWebElement> driver = AppiumDriverFactory.GetDefaultMobileDriver(); #endregion try { Assert.IsNotNull(driver); } finally { driver.Quit(); driver.Dispose(); } }
public void Dispose() { Driver.Quit(); Driver.Dispose(); }
public void TearDown() { _driver.Dispose(); }
public static void CleanUp() { _driver.Quit(); _driver.Dispose(); _driver = null; }
public void EndTest() { driver.Dispose(); driver.Quit(); }