Actions

Playwright can interact with HTML input elements easily. This is a shortened version of the Playwright Actions documentation.

Use locator.fill() which focuses the element and trigger an input event with the desired text.

Usage

await page.locator("input[class='name-input']").fill("Jeff");

Use `locator.check()` to check and uncheck a checkbox or radio button.

Usage

await page.locator("input[type=checkbox]").check();

Use locator.selectOption() to select options in a <select> element.

Usage

await page.getByLabel("Select a frequency").selectOption("15m");

Perform a mouse click

Usage

await page.getByText("Submi").click();

Last updated