public void LaunchSystemApp() { DesiredCapabilities appCapabilities = new DesiredCapabilities(); appCapabilities.SetCapability("app", CommonTestSettings.ExplorerAppId); IOSDriver <IOSElement> session = new IOSDriver <IOSElement>(new Uri(CommonTestSettings.WindowsApplicationDriverUrl), appCapabilities); Assert.IsNotNull(session); Assert.IsNotNull(session.SessionId); var originalTitle = session.Title; var originalWindowHandlesCount = session.WindowHandles.Count; var originalLaunchedWindowHandle = session.CurrentWindowHandle; session.LaunchApp(); Assert.AreEqual(originalTitle, session.Title); Assert.AreEqual(originalWindowHandlesCount + 1, session.WindowHandles.Count); Assert.AreNotEqual(originalLaunchedWindowHandle, session.CurrentWindowHandle); session.Close(); session.SwitchTo().Window(originalLaunchedWindowHandle); session.Close(); session.Quit(); }
public void InitiateDriver() { driver = GetDriver(); driver.LaunchApp(); driver.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(30); driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(30); Console.WriteLine("Driver Initiated Succesfully"); driver.Orientation = ScreenOrientation.Landscape; Console.WriteLine("Setting Device To Landscape Mode"); }
public void ScrollToEndOfListUsingRemoteTouchScreenScroll() { driver.LaunchApp(); var touchScreen = new RemoteTouchScreen(driver); touchScreen.Scroll(0, -300); touchScreen.Scroll(0, -300); driver.CloseApp(); }
public void testSearchIFixitOnHomeScreen() { Console.WriteLine("should allow to search iFixit on Home screen"); /* * Steps: * 1. Reopen iFixit app * 2. Click Search menu on the left menu bar * 3. Search keyword 'Macbook Pro 2015' * 4. Press Enter button on keyboard * * Expected: It should show at least 33 results. * * 5. Clear the current content * 6. Search keyword 'Acura' on Categories tab * * Expected: It should show at least 6 results. */ driver.LaunchApp(); Thread.Sleep(5000); driver.FindElementByXPath("//XCUIElementTypeButton[@name='START A REPAIR']").Click(); Thread.Sleep(2000); driver.FindElementByXPath("//*[@name='Search']").Click(); driver.FindElementByXPath("//XCUIElementTypeSearchField[@name='Search']").SendKeys("Macbook Pro 2015"); Thread.Sleep(2000); IList <IWebElement> firstResult = driver.FindElementsByXPath("//XCUIElementTypeStaticText[contains(@label,'MacBook Pro')]"); driver.FindElementByXPath("//XCUIElementTypeButton[@name='Cancel']").Click(); driver.FindElementByXPath("//*[@name='Search']").Click(); driver.FindElementByXPath("//XCUIElementTypeSearchField[@name='Search']").SendKeys("Acura"); driver.FindElementByXPath("//XCUIElementTypeButton[@name='Categories']").Click(); Thread.Sleep(2000); IList <IWebElement> secondResult = driver.FindElementsByXPath("//XCUIElementTypeStaticText[contains(@label,'Acura')]"); Assert.IsTrue(firstResult.Count >= 34, "The expected results are greater or equal to 33 results."); Assert.IsTrue(secondResult.Count >= 6, "The expected results are greater or equal to 6 results."); }
public void TestInitialize() { _driver?.LaunchApp(); }