public void SearchCaseFour(string from, string to, string numberOfPassangers, string departDate, string returnDate) { Pages.HomePage homePage = new Pages.HomePage(driver); homePage.OpenPage(); homePage.SearchInManyPlace(from, to, numberOfPassangers, departDate, returnDate); foreach (var windowHandle in driver.WindowHandles) { if (windowHandle != driver.CurrentWindowHandle) { driver.SwitchTo().Window(windowHandle); IWebElement dynamicElement = (new WebDriverWait(driver, TimeSpan.Parse("60"))).Until(ExpectedConditions.ElementExists(By.Id("view-itinerary"))); Assert.IsTrue(dynamicElement.Text.Contains("Hide")); } } }
public void SearchCaseTwo(string from, string to, string numberOfPassangers, string departDate, string returnDate) { Pages.HomePage homePage = new Pages.HomePage(driver); homePage.OpenPage(); homePage.SearchInManyPlace(from, to, numberOfPassangers, departDate, returnDate); foreach (var windowHandle in driver.WindowHandles) { if (windowHandle != driver.CurrentWindowHandle) { driver.SwitchTo().Window(windowHandle); IWebElement dynamicElement = (new WebDriverWait(driver, TimeSpan.Parse("60"))).Until(ExpectedConditions.ElementExists(By.XPath("//H3[@small=''][text()='Oops! Something went wrong!']"))); Assert.IsTrue(dynamicElement.Text.Contains("Oops! Something went wrong!")); } } }