Method: Playwright::Page#fill
- Defined in:
- lib/playwright_api/page.rb
#fill(selector, value, noWaitAfter: nil, timeout: nil) ⇒ Object
This method waits for an element matching ‘selector`, waits for [actionability](./actionability.md) checks, focuses the element, fills it and triggers an `input` event after filling. If the element is inside the `<label>` element that has associated [control](developer.mozilla.org/en-US/docs/Web/API/HTMLLabelElement/control), that control will be filled instead. If the element to be filled is not an `<input>`, `<textarea>` or `[contenteditable]` element, this method throws an error. Note that you can pass an empty string to clear the input field.
To send fine-grained keyboard events, use [‘method: Page.type`].
Shortcut for main frame’s [‘method: Frame.fill`]
846 847 848 |
# File 'lib/playwright_api/page.rb', line 846 def fill(selector, value, noWaitAfter: nil, timeout: nil) wrap_impl(@impl.fill(unwrap_impl(selector), unwrap_impl(value), noWaitAfter: unwrap_impl(noWaitAfter), timeout: unwrap_impl(timeout))) end |