Method: Selenium::Client::GeneratedDriver#key_down_native

Defined in:
lib/selenium/client/legacy_driver.rb

#key_down_native(keycode) ⇒ Object

Simulates a user pressing a key (without releasing it yet) by sending a native operating system keystroke. This function uses the java.awt.Robot class to send a keystroke; this more accurately simulates typing a key on the keyboard. It does not honor settings from the shiftKeyDown, controlKeyDown, altKeyDown and metaKeyDown commands, and does not target any particular HTML element. To send a keystroke to a particular element, focus on the element first before running this command.

‘keycode’ is an integer keycode number corresponding to a java.awt.event.KeyEvent; note that Java keycodes are NOT the same thing as JavaScript keycodes!

[View source]

1689
1690
1691
# File 'lib/selenium/client/legacy_driver.rb', line 1689

def key_down_native(keycode)
    remote_control_command("keyDownNative", [keycode,])
end