Finds the first of elements that match the XPath supplied
Namespace: OpenQA.Selenium.RemoteAssembly: WebDriver (in WebDriver.dll) Version: 2.35.0.0 (2.35.0.0)
Syntax
public IWebElement FindElementByXPath( string xpath )
Parameters
- xpath
- Type:
System String
xpath to the element
Return Value
IWebElement object so that you can interact that objectImplements
IFindsByXPath FindElementByXPath(String)Examples
IWebDriver driver = new RemoteWebDriver(DesiredCapabilities.Firefox()); IWebElement elem = driver.FindElementsByXPath("//table/tbody/tr/td/a");
See Also