Actions: click, fill, check and more

Knowledge Videos

Short animated explainers, organised by subject.

Actions: click, fill, check and more

Every verb in a manual test case has a Playwright method: goto, click, fill, check, selectOption, hover, press and setInputFiles, and how Playwright acts like a real user.

Transcript

Actions are what a user does. Every verb in a manual test case has a Playwright method. Open a page with goto. Press a button with click.

Type into a field with fill. It clears the field first, then enters the text. Tick a checkbox with check, and choose from a dropdown with select option.

Move the mouse over something with hover. Press a key, like Enter or Tab, with press. Upload a file with set input files.

Put them together and you get a login. Fill the email, fill the password, tick remember me, and click Log in.

Playwright acts like a real user. Before a click, it waits until the element is visible, enabled, and not moving. Only then does it click. You do not need to add waits.

Remember: each manual verb has a method. Use fill to type, check to tick, and let Playwright wait for you.

More in this series