Method: Playwright::Keyboard#type
- Defined in:
- lib/playwright_api/keyboard.rb
#type(text, delay: nil) ⇒ Object
NOTE: In most cases, you should use [‘method: Locator.fill`] instead. You only need to press keys one by one if there is special keyboard handling on the page - in this case use [`method: Locator.pressSequentially`].
Sends a ‘keydown`, `keypress`/`input`, and `keyup` event for each character in the text.
To press a special key, like ‘Control` or `ArrowDown`, use [`method: Keyboard.press`].
Usage
“‘python sync page.keyboard.type(“Hello”) # types instantly page.keyboard.type(“World”, delay=100) # types slower, like a user “`
NOTE: Modifier keys DO NOT effect ‘keyboard.type`. Holding down `Shift` will not type the text in upper case.
NOTE: For characters that are not on a US keyboard, only an ‘input` event will be sent.
140 141 142 |
# File 'lib/playwright_api/keyboard.rb', line 140 def type(text, delay: nil) wrap_impl(@impl.type(unwrap_impl(text), delay: unwrap_impl(delay))) end |