[Windows] Send Keys
Description
Simulate keystroke events on the specified element by pressing a key or a combination of keys.
Keyword name: sendKeys
Parameters
Parameter | Parameter Type | Required | Description |
---|---|---|---|
windowsObject | WindowsTestObject | Yes | An object that describes the locator and locator strategy to find Windows Element. |
strKeys | String | Yes | A combination of keys to press. |
Method Keys.chord
For pressing a combination of keys, the
Keys.chord
method is used along with the sendKeys
keyword.Method name | Method syntax | Description |
---|---|---|
Keys.chord | Keys.chord(...) or | Simulate pressing many keys at once in a "chord". Takes a sequence of Keys.XXXX or strings; appends each of the values to a string, and adds the chord termination key (Keys.NULL ) and returns the resultant string. Note: When the low-level webdriver key handlers see Keys.NULL, active modifier keys (CTRL/ALT/SHIFT/etc) release via a keyup event. Please see this document for further instructions and examples. |
Example
//Press Ctrl+A on the Edit element
Windows.sendKeys(findWindowsObject('Object Repository/Notepad/Edit'),Keys.chord(Keys.CONTROL,'a'))