Frame.check() method signature and options
Frame.check() is an async method (discouraged, use Locator.check instead). It checks an element matching the selector. Parameters: selector (required). Options: force (boolean), scroll (boolean), noWaitAfter (boolean), position (object), strict (boolean), timeout (number), signal (AbortSignal), trial (boolean).
Frame.fill() method signature and options
Frame.fill() is an async method (discouraged, use Locator.fill instead). It fills an input, textarea, or contenteditable element. Parameters: selector (required), value (string, required). Options: force (boolean), noWaitAfter (boolean), strict (boolean), timeout (number), signal (AbortSignal).
Frame.focus() method signature and options
Frame.focus() is an async method (discouraged, use Locator.focus instead). It focuses an element matching the selector. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.inputValue() method signature and options
Frame.inputValue() is an async method (discouraged, use Locator.inputValue instead) that returns string. It returns input.value for the selected input, textarea, or select element. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.isChecked() method signature and options
Frame.isChecked() is an async method (discouraged, use Locator.isChecked instead) that returns boolean. It returns whether the element is checked. Throws if the element is not a checkbox or radio input. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.isDisabled() method signature and options
Frame.isDisabled() is an async method (discouraged, use Locator.isDisabled instead) that returns boolean. It returns whether the element is disabled. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.isEditable() method signature and options
Frame.isEditable() is an async method (discouraged, use Locator.isEditable instead) that returns boolean. It returns whether the element is editable. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.isEnabled() method signature and options
Frame.isEnabled() is an async method that returns boolean. It returns whether the element is enabled. Parameters: selector (required). Options: strict (boolean), timeout (number), signal (AbortSignal).
Frame.selectOption() method signature and options
Frame.selectOption() is an async method (discouraged, use Locator.selectOption instead) that returns Array<string>. It selects options in a select element. Parameters: selector (required), values (required - string, SelectOption, or array). Options: force (boolean), noWaitAfter (boolean), strict (boolean), timeout (number), signal (AbortSignal). Also supports: element (optional), index (optional), value (optional), label (optional). Returns array of option values that have been successfully selected.
Frame.setChecked() method signature and options
Frame.setChecked() is an async method (discouraged, use Locator.setChecked instead). It checks or unchecks an element matching the selector. Parameters: selector (required), checked (boolean, required). Options: force (boolean), scroll (boolean), noWaitAfter (boolean), position (object), strict (boolean), timeout (number), signal (AbortSignal), trial (boolean).
Frame.setInputFiles() method signature and options
Frame.setInputFiles() is an async method (discouraged, use Locator.setInputFiles instead). It sets the value of a file input to the specified file paths or files. Parameters: selector (required), files (required - string, path, or file object). Options: noWaitAfter (boolean), strict (boolean), timeout (number), signal (AbortSignal). For empty array, clears the selected files.
Frame.selectOption() example
frame.selectOption('select#colors', 'blue'); // Single selection matching the value or label. frame.selectOption('select#colors', { label: 'Blue' }); // single selection matching both the value and the label. frame.selectOption('select#colors', 'red', 'green', 'blue'); // multiple selection.
Page.fill method options and parameters
Page.fill fills form elements with a value. It takes a selector parameter (input selector), a value parameter (string to fill), and options: force, noWaitAfter, strict, timeout, and signal. Available since v1.8. This method waits for the element to match the selector, checks actionability, focuses, fills, and triggers an input event. It works with <input>, <textarea>, and [contenteditable] elements.
Page.focus method
Page.focus fetches an element with the specified selector and focuses it. If no element matches the selector, the method waits until a matching element appears in the DOM. Parameters: selector (input selector). Options: strict, timeout, signal. Available since v1.8. This method is discouraged in favor of Locator.focus.
Page.inputValue return type and usage
Page.inputValue returns string. It returns input.value for the selected <input>, <textarea>, or <select> element. Throws for non-input elements, but if element is inside a <label> with an associated control, returns the value of the control. This method is discouraged in favor of Locator.inputValue. Parameters: selector (input selector). Options: strict, timeout, signal. Available since v1.13.
Page.selectOption is discouraged
Page.selectOption is discouraged. Use locator-based Locator.selectOption instead. Read more about locators.
Page.selectOption example - single selection
```js
// Single selection matching the value or label
page.selectOption('select#colors', 'blue');
// single selection matching the label
page.selectOption('select#colors', { label: 'Blue' });
// multiple selection
page.selectOption('select#colors', ['red', 'green', 'blue']);
```
This example shows how to select options from a select element by value, label, or multiple values.
Page.setChecked method behavior
Page.setChecked checks or unchecks an element matching selector. It finds the element, ensures it is a checkbox or radio input, waits for actionability checks unless force option is set, scrolls into view if needed, uses Page.mouse to click the center, and ensures the element is now checked or unchecked. Throws TimeoutError if timeout is exceeded. Passing zero timeout disables this.
Page.setInputFiles method behavior
Page.setInputFiles sets the value of a file input to the given file paths or files. Relative paths are resolved relative to the current working directory. Empty array clears selected files. For inputs with webkitdirectory attribute, only a single directory path is supported. Expects selector to point to an input element, or targets the control if inside a label element with an associated control.
Page.type is deprecated
Page.type is deprecated. In most cases, use Locator.fill instead. Only use Page.type if there is special keyboard handling on the page, in which case use Locator.pressSequentially.
Page.uncheck method behavior
Page.uncheck unchecks an element matching selector by finding the element, ensuring it is a checkbox or radio input (throwing if not), checking if already unchecked and returning immediately if so, waiting for actionability checks unless force option is set, scrolling into view if needed, using Page.mouse to click the center, and ensuring the element is now unchecked. Throws TimeoutError if timeout is exceeded. Passing zero timeout disables this.