clear
Empty an input field by label
Clear the current value of a labeled input.
Syntax
When I clear "<target>" [by …]Requirements
| Item | Contract |
|---|---|
| Element / control shape | Same as fill: input / textarea only |
| How the label binds | Same fill auto-find order (id, data-testid, aria-label, name, placeholder, …) |
| Qualifiers that change resolve | Optional by … find hint |
| Platform | Web / mobile |
| Wrong shape → use instead | Non-input controls → not supported for clear |
When it fails
- Same patterns as fill: not found / timeout / disabled / ambiguous.
See also UI contracts.
Examples
When I clear "search"
When I fill "search" with "laptop"
When I clear "search" by name