Playwright + Python · Lesson 17 of 37
Module 17: Web Element Actions
Your task
Implement fill_credentials_and_submit(page, email, password):
Write it in the editor, then press Check answer (Ctrl + Enter).
page.get_by_label("Username").fill("sdet_pro")
page.get_by_label("Username").clear()
page.get_by_label("Subscribe").check()
page.locator("#country").select_option("Canada")
page.get_by_role("button", name="Menu").hover()
page.locator("#source").drag_to(page.locator("#target"))Playwright actions dispatch trusted hardware events that mimic human user interactions. In this lesson, you will master fill, click, check, uncheck, select_option, hover, and drag_to. Let's explore element actions!
Part of the Playwright + Python course (Playwright with Python). Practice this concept live in the Playwright Online Compiler or explore our free automation practice form.
fill() instantly sets the value after checking actionability. type() types character-by-character, useful for auto-suggest testing.
Ready? Solve the task in the editor
Use Check answer to mark it complete. Hints are there if you need them.
___