public EmployeeListPage SelectEmployee(string fullName) { var listEntry = EmployeeList.FindElement( By.XPath(string.Format("./li[contains(text(),'{0}')]", fullName))); if (listEntry.Text != fullName) { throw new Exception(String.Format("Employee '{0}' not found.", fullName)); } listEntry.Click(); return(this); }
public bool EmployeeListContainsEmployee(string fullName) { IWebElement listEntry; try { listEntry = EmployeeList.FindElement( By.XPath(string.Format("./li[contains(text(),'{0}')]", fullName))); } catch (NoSuchElementException ex) { return(false); } return(listEntry.Text == fullName); }