Finds the first element in the page that matches the ID supplied

Namespace: OpenQA.Selenium.Remote
Assembly: WebDriver (in WebDriver.dll) Version: 2.21.0.0 (2.21.0.0)

Syntax

C#
public IWebElement FindElementById(
	string id
)
Visual Basic
Public Function FindElementById ( _
	id As String _
) As IWebElement
Visual C++
public:
virtual IWebElement^ FindElementById(
	String^ id
) sealed

Parameters

id
Type: System..::..String
ID of the element

Return Value

IWebElement object so that you can interction that object

Implements

IFindsById..::..FindElementById(String)

Examples

CopyC#
IWebDriver driver = new RemoteWebDriver(DesiredCapabilities.Firefox());
IWebElement elem = driver.FindElementById("id")

See Also