StrikekitStrikekit

fill

Type into a labeled input field

Fill a field identified by its label (or find hint). The value after with is a payload — a * there is a literal character, not a glob.

Syntax

When I fill "<target>" [by …] with "<value>"

Qualifiers

QualifierRoleExample
withValue to typefill "username" with "chamodh"
by aria-label / by data-testid / by id / by name / by text / by role "…" / by attributeOptional find hint after the targetfill "Email" by aria-label with "a@b.com" · fill "my-custom-hook" by attribute with "Zoe"

Only one find strategy per step. Without by …, StrikeTest auto-finds the field (including late unique data-* attribute presence on web — see Find hints).

Requirements

ItemContract
Element / control shapeinput or textarea only (id, name, placeholder, aria-label, data-testid on those tags). Not contenteditable divs or custom editors.
How the label bindsid → input/textarea data-testid → input/textarea aria-label → input name → input placeholder → textarea name → textarea placeholder (+ late unique data-* on web)
Qualifiers that change resolveby … forces a single strategy on the target; with value is a payload (* stays literal)
PlatformWeb and mobile (same label grammar)
Wrong shape → use insteadContenteditable / rich-text widgets → expose a native input or test hook. Custom combobox → open / pick, not fill alone.

When it fails

  • Timeout / not found — label missed or control is not an input/textarea.
  • element is disabled — field is disabled.
  • Ambiguous — more than one matching field.

See also UI contracts.

Examples

When I fill "username" with "chamodh"
And I fill "password" with "1234"
When I fill "email" by name with "a@b.com"
When I fill "data-employee-name" by attribute with "Ada"
When I fill "my-custom-hook" by attribute with "Zoe"
When I fill "search" with "a*b"

Notes

  • Target "username" is a match/lookup label — * in the target acts as a glob and must resolve to exactly one visible field.
  • Works on web and mobile (same label grammar).

On this page