BeginnerPW-LOC-00215 minutesPlaywright

Fill a profile with label locators

A profile form exposes durable labels but implementation-specific ids may change.

  • locators
  • forms

Objective

What to automate

Fill the labelled name and email fields and assert their values.

Preconditions and test data

Preconditions

  • Use a fresh isolated Practice Lab browser context.
  • Open the fixture identified by FX-INPUT-001.

Test data

  • name: Asha Learner
  • email: asha.learner@example.test

Expected result

Both inputs contain the supplied synthetic values.

Progressive hints

Hint 1

Use getByLabel.

Hint 2

Avoid placeholder selectors.

Hint 3

Assert with toHaveValue after filling.

I’ve tried it — show solution
  1. Use getByLabel.
  2. Avoid placeholder selectors.
  3. Assert with toHaveValue after filling.