コード例 #1
0
        public static bool FindElementHeaderText(WebDriverWait wait, String ClassName, String TagName, String text)
        {
            WebItem     Item    = new WebItem("", ClassName, "", TagName);
            IWebElement element = TestFramework.FindWebElement(Item);

            return(wait.Until(ExpectedConditions.TextToBePresentInElement(element, text)));
        }
コード例 #2
0
        public static IWebElement FindWebElement(WebItem webItem)
        {
            if (webItem.ID != "")
            {
                return(WebDriver.FindElement(By.Id(webItem.ID)));
            }

            if (webItem.ClassName != "")
            {
                return(WebDriver.FindElement(By.ClassName(webItem.ClassName)));
            }

            if (webItem.XPathQuery != "")
            {
                return(WebDriver.FindElement(By.XPath(webItem.XPathQuery)));
            }

            if (webItem.TagName != "")
            {
                return(WebDriver.FindElement(By.TagName(webItem.TagName)));
            }

            return(null);
        }