Simulates typing text into the element.

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

Syntax

C#
void SendKeys(
	string text
)
Visual Basic
Sub SendKeys ( _
	text As String _
)
Visual C++
void SendKeys(
	String^ text
)

Parameters

text
Type: System..::..String
The text to type into the element.

Remarks

The text to be typed may include special characters like arrow keys, backspaces, function keys, and so on. Valid special keys are defined in Keys.

Exceptions

ExceptionCondition
OpenQA.Selenium..::..InvalidElementStateExceptionThrown when the target element is not enabled.
OpenQA.Selenium..::..ElementNotVisibleExceptionThrown when the target element is not visible.
OpenQA.Selenium..::..StaleElementReferenceExceptionThrown when the target element is no longer valid in the document DOM.

See Also