示例#1
0
        /// <summary>
        /// Get the page header text.
        /// </summary>
        /// <returns>
        /// The page header text with leading and trailing whitespace removed.
        /// </returns>
        public string GetHeaderText()
        {
            SeleniumTestUtils.WaitForPresenceOfElement(driver, elementTimeout, By.XPath("//h1"));
            SeleniumTestUtils.HighlightElement(driver, h1);

            return(h1.Text.Trim());
        }
示例#2
0
        /// <summary>
        /// Get the zip code field value.
        /// </summary>
        /// <returns>
        /// A zip code.
        /// </returns>
        public string GetZipCode()
        {
            SeleniumTestUtils.WaitForPresenceOfElement(driver, elementTimeout, By.XPath("//input[@name='zip']"));
            SeleniumTestUtils.HighlightElement(driver, zipCodeInput);

            return(zipCodeInput.GetAttribute("value").Trim());
        }
示例#3
0
        /// <summary>
        /// Get the selected car model.
        /// </summary>
        /// <returns>
        /// The name of a car model.
        /// </returns>
        public string GetSelectedModel()
        {
            SeleniumTestUtils.WaitForPresenceOfElement(driver, elementTimeout, By.XPath("//select[@name='model']"));
            SeleniumTestUtils.HighlightElement(driver, modelSelector);

            var selector = new SelectElement(modelSelector);

            return(selector.SelectedOption.Text.Trim());
        }