protected bool FilterResultsUsingColumnFilter(string module, string columnName, string filterText) { int initialrowCount = GetGridRowCount(); int currentrowCount = 0; ElementLocator columnFilter = new ElementLocator(Locator.Id, "Grid_{0}_Filter_{1}"); try { IWebElement resultFilter = Driver.GetElement(columnFilter.Format(module, columnName)); Driver.Actions().SendKeys(resultFilter, filterText).Perform(); Driver.Actions().SendKeys(resultFilter, Keys.Enter).Perform(); Driver.WaitForAjax(); currentrowCount = GetGridRowCount(); if (initialrowCount != currentrowCount) { return(currentrowCount == 0 ? true : Driver.PageSource.Contains(filterText)); } } catch (TimeoutException ex) { logger.Error("Encountered exception in FilterResultsUsingColumnFilter:{0}", ex.Message); } return(false); }
protected bool PerformKeywordSearch(string moduleName, string filterText) { int initialRowCount = GetGridRowCount(); ElementLocator keywordSearchCtrl = new ElementLocator(Locator.Id, "{0}_Search_Keywords"); IWebElement keywordCtrl = Driver.GetElement(keywordSearchCtrl.Format(moduleName)); keywordCtrl.SendKeys(filterText); keywordCtrl.SendKeys(Keys.Enter); Driver.WaitForAjax(); return(initialRowCount > GetGridRowCount() ? true : false); }
public LoginPageObjects ClickOnButton(string buttonName) { Driver.GetElement(_buttonLocator.Format(buttonName), 5).Click(); return(this); }
public static ReadOnlyCollection <IWebElement> FindElements(this IWebDriver driver, ElementLocator locator, params object[] parameters) { locator = locator.Format(parameters); new WebDriverWait(driver, TimeSpan.FromSeconds(Wait)).Until(drv => driver.FindElements(locator.ToBy(locator)).Count > 0); return(driver.FindElements(locator.ToBy(locator))); }