Playwright + Java · Lesson 18 of 38
Module 18: Web Element Actions
Your task
Implement fillAndSubmit:
Write it in the editor, then press Check answer (Ctrl + Enter).
page.getByLabel("Username").fill("automation_sdet");
page.getByLabel("Username").clear();
page.getByLabel("I agree to terms").check();
page.locator("#country-select").selectOption("US");
page.locator("#menu-dropdown").hover();
page.keyboard().press("Control+A");Playwright executes hardware-level interactions that simulate real human users. In this lesson, you will master clicking, filling text fields, checking checkboxes, selecting dropdown options, hovering, and keyboard combinations. Let's explore element actions!
Part of the Playwright + Java course (Playwright with Java). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
fill() clears the input and inserts the whole text instantly after awaiting actionability. type() presses each key one by one.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___