public void ExploreCruiseTest() { DashBoardPage dashBoardPage = new DashBoardPage(driver); dashBoardPage.ClickOnHambergerMenu(); dashBoardPage.ClickOnPlanCruise(); dashBoardPage.ClickOnFindCruise(); CruisePage cruisePage = new CruisePage(driver); cruisePage.WaitforPresenceOfSamplerCruise(); cruisePage.ClickOnSamplerCruise(); Thread.Sleep(3000); cruisePage.ClickOnViewItineraryDetails(); //get no of rows IWebElement tableEle = driver.FindElement(By.XPath("//table[contains(@class,'product-view-itinerary-overview__table')]")); ReadOnlyCollection <IWebElement> rowEles = driver.FindElements(By.XPath("//table[@class='product-view-itinerary-overview__table']/tbody/tr")); int noOfrow = rowEles.Count; //get DayandPort text for (int i = 1; i <= noOfrow - 1; i++) { IWebElement row = rowEles[i]; string day = driver.FindElement(By.XPath("//table[@class='product-view-itinerary-overview__table']/tbody/tr[" + i + "]/td[1]")).Text; string port = driver.FindElement(By.XPath("//table[@class='product-view-itinerary-overview__table']/tbody/tr[" + i + "]/td[2]/div[1]")).Text; } //Couldn't do assertion }
public void ExploreShipsTest() { DashBoardPage dashBoardPage = new DashBoardPage(driver); bool isWhalePresent = dashBoardPage.CheckPresenceOfWhaleWatchingLink(); dashBoardPage.WaitForHambergerMenu(); dashBoardPage.ClickOnHambergerMenu(); dashBoardPage.ClickOnExperience(); dashBoardPage.ClickOnOurShips(); ShipsPage shipsPage = new ShipsPage(driver); shipsPage.ChooseRhapsodyOfTheSeas(); DeckPlanPage deckPlanPage = new DeckPlanPage(driver); deckPlanPage.WaitForDeckPlan(); deckPlanPage.ClickOnDeckPlans(); deckPlanPage.WaitForViewEle(); deckPlanPage.ChangeToDeckEight(); deckPlanPage.WaitforpresenceofRoyalSuite(); //Check the presence of "Royal Suite" bool isRoyalSuitePresent = deckPlanPage.CheckPresenceOfRoyalSuite(); bool isBothPresent = false; if (isWhalePresent == true && isRoyalSuitePresent == true) { isBothPresent = true; } Assert.True(isBothPresent, "Does not meet all requirenment", null); }