Skip to content
masterclass Buddy

Playwright · Method

locator.fill

locator.fill() sets the value of an input, textarea, or contenteditable element. It is Playwright's usual method for entering form text and can also clear a field with an empty string.

Last updated

Since
v1.14

Syntax

locator.fill(value, *, timeout=None, no_wait_after=None, force=None, trial=None)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • get_by_label
  • get_by_placeholder
  • get_by_role
  • press_sequentially
  • input_value

Source: Actions | Playwright Python. Checked 2026-11-03.