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);
        }