Skip to main content
Fill an input field using a CSS selector, an AI prompt, or both. Supports TOTP code injection for 2FA fields.
# Standard Playwright fill
await page.fill("#email", value="user@example.com")

# AI-powered fill
await page.fill(prompt="Fill 'user@example.com' in the email field")

# Selector with AI fallback
await page.fill("#email", value="user@example.com",
    prompt="Fill the email address field")
ParameterTypeRequiredDescription
selectorstr / stringNoCSS selector for the input field.
valuestr / stringNoThe text value to fill into the field.
promptstr / stringNoNatural language description of the field and the value to enter.
aistr / stringNoControls AI behavior. "fallback" (default) tries the selector first, then AI. None / null disables AI.
totp_identifier / totpIdentifierstr / stringNoIdentifier for a stored TOTP secret to generate a one-time code.
totp_url / totpUrlstr / stringNoTOTP provisioning URL (otpauth://...) to generate a one-time code on the fly.
**kwargsNoStandard Playwright fill options (e.g., timeout, force).
Returns str / string — the resolved selector used.