public void SelectByValue(string value) { Trace.WriteLine(BasePage.TraceLevelElement + "Select '" + value + "' in the list '" + _dropDownId + "'"); BasePage.WaitForElement(_driver, _dropDownId).Click(); BasePage.WaitForElement(_driver, By.XPath("//div[contains(@class, '-tree')]//a[text() = '" + value + "']")).ScrollIntoView().Click(); BasePage.WaitForElement(_driver, By.XPath("//a[@class = 'selected-value' and text() ='" + value + "']")).Info(); //BasePage.WaitForElement(_driver, By.XPath("//a[@class = 'selected-value' and text() ='" + value + "']")).WaitTillVisible(); }
private void VerifyQuickSearch(BasePage currentPage) { currentPage.WaitAndType(By.XPath(BasePage.SearchBox), "awesome"); currentPage.WaitForElement(By.XPath("//ul[@class = 'searchSkinObjectPreview']"), 60); Assert.IsTrue(currentPage.ElementPresent(By.XPath("//li/a[@class = 'searchSkinObjectPreview_more']")), "The link 'See More Results' is missing"); Assert.That(currentPage.FindElements(By.XPath("//ul[@class = 'searchSkinObjectPreview']/li[@data-url]")).Count, Is.AtLeast(1), "At least one item is displayed"); }
public void ClickOnButton(By buttonName) { Trace.WriteLine(BasePage.TraceLevelElement + "Click on button:"); //FindElement(By.Id(BasePage.CopyrightNotice)).ScrollIntoView().WaitTillVisible(); //Click(buttonName); IWebElement button = BasePage.WaitForElement(_driver, buttonName); if (button.Displayed) { FindElement(By.Id(BasePage.CopyrightNotice)).ScrollIntoView().WaitTillVisible(); FindElement(buttonName).Click(); } }
public void OpenTab(By tabName) { Trace.WriteLine(BasePage.TraceLevelElement + "Click on Tab:"); //WaitForElement(tabName); //FindElement(By.XPath(BasePage.SearchBox)).ScrollIntoView().WaitTillVisible(); //Click(tabName); IWebElement tab = BasePage.WaitForElement(_driver, tabName); if (tab.Displayed) { FindElement(By.XPath(BasePage.SearchBox)).ScrollIntoView().WaitTillVisible(); FindElement(tabName).Click(); } }
public void Open() { IWebElement accordion = BasePage.WaitForElement(_driver, _accordionId); if (accordion.Displayed) { accordion.ScrollIntoView().WaitTillVisible(); } accordion.Info(); //if (accordion.GetAttribute("class").Contains() != "dnnSectionExpanded") if (!accordion.GetAttribute("class").Contains("dnnSectionExpanded")) { accordion.Click(); //BasePage.WaitForElement(_driver, accordion.GetAttribute(); Thread.Sleep(1000); } }