public static void VerifyAllFooterLinks(RemoteWebDriver driver) { //(new Act("All footer links should display")); Selenide.ScrollToElement(driver, Util.GetLocator("footerlnk_pro")); string[] footerlinks = { "Pro", "Web Apps", "Mobile Apps", "Products", "Business Solutions", "API & Developer Solutions", "About", "Resources & Tools", "Blog", "Community", "Contact", "Connect" }; int leanth = footerlinks.Length; for (int i = 0; i < leanth; i++) { if (footerlinks[i] == "Connect") { Selenide.WaitForElementVisible(driver, Util.GetLocator("footerlnk_pro")); Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//li[@id='footer-top-links']/descendant::a[contains(text(),'" + footerlinks[i] + "')]")); } else { Selenide.WaitForElementVisible(driver, Util.GetLocator("footerlnk_pro")); Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//li[@id='footer-top-links']/descendant::a[text()='" + footerlinks[i] + "']")); } } //last bottom links string[] bottomlinks = { "wolfram.com", "Wolfram Language", "Wolfram for Education", "Wolfram Demonstrations", "Mathematica", "MathWorld" }; int bleanth = bottomlinks.Length; for (int i = 0; i < bleanth; i++) { Selenide.Query.isElementVisible(driver, Locator.Get(LocatorType.XPath, "//a[text()='" + bottomlinks[i] + "']")); } test.Log(LogStatus.Pass, "Verified all footer links"); }
public static void EnterSearchInput(RemoteWebDriver driver, string searchinput) { //Enter the search input: what is the size of the sun Selenide.ScrollToElement(driver, Util.GetLocator("NavigationBar")); Selenide.SetText(driver, Util.GetLocator("NavigationBar"), Selenide.ControlType.Textbox, searchinput); Selenide.Click(driver, Util.GetLocator("search_Btn")); test.Log(LogStatus.Pass, "Entered the search input text is 'what is the size of the sun'"); }
public static void ClickSigninBtn(RemoteWebDriver driver) { Selenide.BrowserBack(driver); //"Click Sign in from the navigation bar" Selenide.Wait(driver, 5, true); Selenide.ScrollToElement(driver, Util.GetLocator("Signin_btn")); Selenide.Click(driver, Util.GetLocator("Signin_btn")); }
public static void ClickMetricBtn(RemoteWebDriver driver) { //Click the "Non Show Metric" button Selenide.Wait(driver, 5, true); Selenide.ScrollToElement(driver, Util.GetLocator("ShowMetricBtn")); Selenide.Click(driver, Util.GetLocator("ShowMetricBtn")); Selenide.Wait(driver, 5, true); //Verify that the non-metric value is not present //Validate in kilometers Selenide.Query.isElementVisible(driver, Util.GetLocator("Kilometers695700")); test.Log(LogStatus.Pass, "The radius of the sun is 432300 kilometers displayed"); bool nonmetricvalue = Selenide.Query.isElementVisibleboolValue2(driver, Util.GetLocator("Radiussun432300")); if (!nonmetricvalue) { test.Log(LogStatus.Pass, "The metric value is not present"); } else { throw new Exception("The non metric value displayed"); } }