public void SearchFor(string searchCriteria) { IWebDriver driver = RuntimeData.Get("driver") as IWebDriver; driver.FindElement(By.Id(SearchInputBoxId)).SendKeys(searchCriteria); driver.FindElement(By.Id(SearchButtonId)).Click(); }
public long GetNumberOfSearchResults() { IWebDriver driver = RuntimeData.Get("driver") as IWebDriver; string numberOfResults = driver.FindElement(By.Id(NumberOfSearchResultsId)).Text; long numberOfSearchResults = Convert.ToInt32(new Regex(" results.*").Replace(numberOfResults, "").Replace("About ", "").Replace(",", "")); Console.WriteLine("Number of Search Results: " + numberOfSearchResults); return(numberOfSearchResults); }
public static void NavigateTo(string url) { var driver = RuntimeData.Get("driver") as IWebDriver; driver.Navigate().GoToUrl(url); }