This method clicks the element by performing the following steps:
force option is set.position.noWaitAfter option is set.If the element is detached from the DOM at any moment during the action, this method throws.
When all steps combined have not finished during the specified timeout, this method throws a [TimeoutError]. Passing
zero timeout disables this.
Optional timeout?: numberThe method finds all elements matching the specified selector and passes an array of matched elements as a first argument
to pageFunction. Returns the result of pageFunction invocation.
If pageFunction returns a [Promise], then
selector.evaluateAll(pageFunction[, arg]) would
wait for the promise to resolve and return its value.
Examples:
const elements = page.selector('div');
const divCounts = await elements.evaluateAll((divs, min) => divs.length >= min, 10);
Optional argument to pass to pageFunction.
This method waits for actionability checks, focuses the element, fills it and triggers an input
event after filling. Note that you can pass an empty string to clear the input field.
If the target element is not an <input>, <textarea> or [contenteditable] element, this method throws an error.
However, if the element is inside the <label> element that has an associated
control, the control will be filled
instead.
To send fine-grained keyboard events, use selector.type(text[, options]).
Value to set for the <input>, <textarea> or [contenteditable] element.
This method waits for actionability checks, waits until all specified options are present in the
<select> element and selects these options.
If the target element is not a <select> element, this method throws an error. However, if the element is inside the
<label> element that has an associated
control, the control will be used instead.
Returns the array of option values that have been successfully selected.
Triggers a change and input event once all the provided options have been selected.
// single selection matching the value
element.selectOption('blue');
// single selection matching the label
element.selectOption({ label: 'Blue' });
// multiple selection
element.selectOption(['red', 'green', 'blue']);
Options to select. If the <select> has the multiple attribute, all matching options are selected, otherwise only the first option matching one of the passed options is selected. String values are equivalent to {value:'string'}. Option
is considered matching if all specified properties match.
This method waits for actionability checks, then focuses the element and selects all its text content.
If the element is inside the <label> element that has an associated
control, focuses and selects text in the
control instead.
Optional accept_if: ((code?: string, error?: string) => Promise<boolean>)Optional code: stringOptional error: string
This method checks the element by performing the following steps:
forceoption is set.noWaitAfteroption is set.If the element is detached from the DOM at any moment during the action, this method throws.
When all steps combined have not finished during the specified
timeout, this method throws a [TimeoutError]. Passing zero timeout disables this.