コード例 #1
0
        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();
        }
コード例 #2
0
        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);
        }
コード例 #3
0
        public static void NavigateTo(string url)
        {
            var driver = RuntimeData.Get("driver") as IWebDriver;

            driver.Navigate().GoToUrl(url);
        }