public QuestionPage TypeSearchTextAndSelect(string pathway) { SearchTxtBox.Clear(); SearchTxtBox.SendKeys(pathway); this.ClickGoButton(); new WebDriverWait(_driver, TimeSpan.FromSeconds(5)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//div[@class='results-list']/ul/li"))); _driver.FindElement(By.XPath("//div[@class='results-list']/ul/li/a[@data-title='" + pathway + "']")).Click(); return(new QuestionPage(_driver)); }
public QuestionPage TypeSearchTextAndSelect(string pathway) { SearchTxtBox.Clear(); SearchTxtBox.SendKeys(pathway); this.ClickNextButton(); new WebDriverWait(Driver, TimeSpan.FromSeconds(5)).Until(ExpectedConditions.ElementIsVisible(By.XPath("//ul[contains(@class, 'link-list') and contains(@class, 'link-list--results')]/li"))); Driver.FindElement(By.XPath("//ul[contains(@class, 'link-list') and contains(@class, 'link-list--results')]/li/a[@data-title='" + pathway + "']")).Click(); return(new QuestionPage(Driver)); }
/// <summary> /// Bug already logged. Search button doesn't work rather user Enter key /// Method to Search device based on serial, name, ip address /// </summary> /// <param name="deviceinfo"></param> public List <DeviceListModel> SearchDevice(string deviceinfo) { try { WaitElementToBeClickable(SearchBtn); ClickElement(SearchBtn); EnterValueTextbox(SearchTxtBox, deviceinfo); SearchTxtBox.SendKeys(Keys.Enter); Logger.Info("Searched devices with criteria: " + deviceinfo); } catch (Exception ex) { Logger.Error(ex, "Failed to Search Device"); throw; } return(GetDeviceListDetails()); }
public void SearchByTerm(string term) { SearchTxtBox.Clear(); SearchTxtBox.SendKeys(term); ClickNextButton(); }