/// <summary> /// Sets capabilities for testing the Windows application driver creation /// </summary> /// <returns>Windows application driver instance of the Appium Driver</returns> protected override AppiumDriver GetMobileDevice() { AppiumOptions options = new AppiumOptions(); options.App = $"{Environment.SystemDirectory}\\notepad.exe"; return(AppiumDriverFactory.GetWindowsDriver(new Uri("http://127.0.0.1:4723/wd/hub"), options, TimeSpan.FromSeconds(30))); }
public void LaunchWebBrowser() { var runOnRemote = Config.Settings.RuntimeSettings.RunOnRemoteMachine; if (runOnRemote == "SeleniumGrid") { Driver = new RemoteDriverFactory().CreateWebDriver(); } else if (runOnRemote == "Appium") { Driver = AppiumDriverFactory.CreateAppiumDriver(); } else { Logger.Debug("Creating Web Driver..."); Driver = new LocalDriverFactory().CreateWebDriver(); //try //{ // Driver = new LocalDriverFactory().CreateWebDriver(); //} //catch (WebDriverException) //{ // CloseWebBrowser(); //} } }
public void OverrideDriverFuncRespected() { var driver = AppiumDriverFactory.GetDefaultMobileDriver(); this.TestObject.OverrideWebDriver(() => driver); Assert.AreEqual(driver, this.AppiumDriver); }
public void SetMobileOptionsWithNullDictionary() { var options = AppiumDriverFactory.GetDefaultMobileOptions(); var beforeOptions = options.ToDictionary(); // Add null options.SetMobileOptions(null); // Makes sure we didn't add or remove options Assert.AreEqual(beforeOptions.Count, options.ToDictionary().Count); }
public void SeparateLazyElementInteractions() { MobileDriverManager newDriver = new MobileDriverManager(() => AppiumDriverFactory.GetDefaultMobileDriver(), this.TestObject); newDriver.GetMobileDriver().Navigate().GoToUrl("https://magenicautomation.azurewebsites.net/"); this.ManagerStore.Add("test", newDriver); this.TestObject.AppiumDriver.Navigate().GoToUrl("https://magenicautomation.azurewebsites.net/Automation"); LazyMobileElement topNew = new LazyMobileElement(this.TestObject, newDriver.GetMobileDriver(), By.CssSelector("*")); LazyMobileElement topDefault = new LazyMobileElement(this.TestObject, By.CssSelector("*")); Assert.AreNotEqual(topNew.Text, topDefault.Text); }
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(); } }
/// <summary> /// Sets capabilities for testing the iOS Driver creation /// </summary> /// <returns>iOS instance of the Appium Driver</returns> protected override AppiumDriver GetMobileDevice() { AppiumOptions options = new AppiumOptions { DeviceName = "iPhone 13 Simulator", PlatformName = "iOS", PlatformVersion = "15.0", BrowserName = "Safari" }; var sauceOptions = AppiumConfig.GetCapabilitiesAsObjects(); // Use Appium 1.22 for running iOS tests (sauceOptions["sauce:options"] as Dictionary <string, object>)["appiumVersion"] = "1.22.0"; options.SetMobileOptions(sauceOptions); return(AppiumDriverFactory.GetIOSDriver(AppiumConfig.GetMobileHubUrl(), options, AppiumConfig.GetMobileCommandTimeout())); }
public void OverrideDriverRespected() { var driver = AppiumDriverFactory.GetDefaultMobileDriver(); this.TestObject.OverrideAppiumDriver(driver); }