OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath C# (CSharp) 메소드

FindElementByXPath() 공개 메소드

Finds the first of elements that match the XPath supplied
public FindElementByXPath ( string xpath ) : IWebElement
xpath string xpath to the element
리턴 IWebElement
        public IWebElement FindElementByXPath(string xpath)
        {
            return this.FindElement("xpath", xpath);
        }

Usage Example

예제 #1
0
        protected IWebElement FindElement(RemoteWebDriver webDriver, Selector element)
        {
            switch (element.Type)
            {

                case ExtractType.XPath:
                    {
                        return webDriver.FindElementByXPath(element.Expression);
                    }
                case ExtractType.Css:
                    {
                        return webDriver.FindElementByCssSelector(element.Expression);
                    }
            }
            throw new SpiderExceptoin("Unsport findy: " + element.Type);
        }