Skip to main content
Fill a single-page form using AI. Pass a data dict describing the values to fill.
await page.fill_form(
    data={"name": "John Doe", "email": "john@example.com", "role": "Engineer"},
)

# With a custom prompt to guide the AI
await page.fill_form(
    data={"name": "John Doe", "email": "john@example.com"},
    prompt="Fill out the registration form with the provided user details",
)
ParameterTypeRequiredDescription
datadict[str, Any]YesKey-value pairs of form data to fill.
promptstrNoInstruction for the AI. Defaults to "Fill out the form".

Returns None