Actions and Forms

Practice clicks, typing, selects, and simple form fills.

Playwright Automation Module 2 Lesson 3
10 min read

What you'll learn

  • Use the main user actions.
  • Fill forms like a real user.
  • Choose the right action for the element.

Actions and Forms

Practice clicks, typing, selects, and simple form fills.

Big Picture

One small picture can make this idea easier to hold.

Right action

  • Use fill for text fields.
  • Use click for buttons.
  • Use selectOption for dropdowns.
  • Use check for checkboxes.

Wrong action

  • Click the text input to type.
  • Type into a button.
  • Scroll and hope it changes.
  • Guess the field type.

VerdictPicking the right action keeps tests clear and stable.

How It Moves

Short steps make the flow easier to see.

1

Find the field

Locate the input, select, or checkbox.

2

Choose the action

Pick fill, click, check, or select.

3

Enter the data

Type the value or choose an option.

Submit it

Press the final button and check the result.

Step By Step

This is the same idea, stretched across time.

  1. 1

    Open the form

    Get to the input you want to test.

  2. 2

    Set values

    Fill text, select items, or check boxes.

  3. 3

    Submit the form

    Trigger the save or search action.

  4. 4

    Check the result

    Make sure the page shows the new state.

One Small Model

Think of this like a tiny card you can keep in your pocket.

Form snapshot

5 fields
Name:"Ada"
Email:"ada@example.com"
Plan:"Pro"
Agree:"Checked"
Submit:"Ready"
Each form field has a matching action.

Quick Check

Question 1 of 10 correct

What does fill do in a form test?

Map It

One more picture helps you see where this lesson matters most.

Action fit map

Action match
Good fit

Best fit

fill a text field

Good fit

click a button

Bad fit

click a checkbox label and hope

Okay fit

select one option

Bad fit
Simple inputComplex input
Form type
Match the action to the control, not the other way around.

Final Quiz

Question 1 of 30 correct

Which action is best for a text box?