Performs a key press.
Performs a key release.
Sends keys to the active element.
Performs a key press. Does not release the key - subsequent interactions may assume it’s kept pressed. Note that the key is never released implicitly - either ActionBuilder#key_up(key) or ActionBuilder#release_actions must be called to release the key.
47 48 49
# File 'rb/lib/selenium/webdriver/common/interactions/key_actions.rb', line 47 def key_down(*, device: nil) key_action(*, action: :create_key_down, device: device) end#key_up(key, device: nil) ⇒ ActionBuilder #key_up(element, key, device: nil) ⇒ ActionBuilder
Performs a key release. Releasing a non-depressed key will yield undefined behaviour.
74 75 76
# File 'rb/lib/selenium/webdriver/common/interactions/key_actions.rb', line 74 def key_up(*, device: nil) key_action(*, action: :create_key_up, device: device) end#send_keys(keys, device: nil) ⇒ ActionBuilder #send_keys(element, keys, device: nil) ⇒ ActionBuilder
Sends keys to the active element. This differs from calling Element#send_keys(keys) on the active element in two ways:
The modifier keys included in this call are not released.
There is no attempt to re-focus the element - so send_keys(:tab) for switching elements should work.
104 105 106 107 108 109 110 111
# File 'rb/lib/selenium/webdriver/common/interactions/key_actions.rb', line 104 def send_keys(*args, device: nil) click(args.shift) if args.first.is_a? Element args.map { |x| x.is_a?(String) ? x.chars : x }.flatten.each do |arg| key_down(arg, device: device) key_up(arg, device: device) end self end
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4