← Autofill event

v147 · experimental · webdriver bidi command

The autofill.trigger command

The Autofill Event spec defines a WebDriver BiDi module, autofill, with one command: autofill.trigger. It triggers autofill on a form field with caller-supplied card or address data, so automated tests can exercise the autofill event and refill() flow without a real user profile or manual interaction.

Experimental — API surface may move Defined in the same incubating WICG draft as the parent feature (experimental in Chromium; Origin trial per the milestone-147 listing, “Proposed” on the detail record). See the overview warn-block for evidence and enable steps.

syntax

Command definition quoted verbatim (CDDL) from spec §7.1.1:

autofill.Trigger = (
  method: "autofill.trigger",
  params: autofill.TriggerParameters
)

autofill.TriggerParameters = {
  context: browsingContext.BrowsingContext,
  element: script.SharedReference,
  ? card: autofill.Card,
  ? address: autofill.Address
}

autofill.Card = {
  number: text,
  name: text,
  expiryMonth: text,
  expiryYear: text,
  cvc: text
}

autofill.Address = {
  fields: [ * autofill.Field ]
}

autofill.Field = {
  name: autofill.FieldName,
  value: text
}

autofill.FieldName is the enumeration "name" / "honorific-prefix" / "given-name" / "additional-name" / "family-name" / "honorific-suffix" / "nickname" / "organization" / "street-address" / "address-line1" / "address-line2" / "address-line3" / "address-level4" / "address-level3" / "address-level2" / "address-level1" / "country" / "country-name" / "postal-code" / "tel" / "tel-country-code" / "tel-national" / "tel-area-code" / "tel-local" / "email" — corresponding to the HTML autofill field names.

Source: spec §7.1.1 (CDDL and FieldName values quoted verbatim). Read 2026-10-04.

parameters

contextA browsingContext.BrowsingContext id; resolved to a navigable whose active document hosts the fill.
elementA script.SharedReference to the target form field; it must deserialize to a form control that has a non-null form owner.
cardOptional autofill.Card (number, name, expiryMonth, expiryYear, cvc — all text).
addressOptional autofill.Address: a list of autofill.Field name/value pairs using the FieldName enumeration above.

Exactly one of card / address must be present — both, or neither, is an invalid argument error (processing steps 10–11).

Source: spec §7.1.2 processing steps. Read 2026-10-04.

return value

Return type EmptyResult: on success the remote end returns success with data null (final processing step). The command reports no fill details; observe the effect in-page via the autofill event and the resulting control values.

Source: spec §7.1.1 Return Type, §7.1.2. Read 2026-10-04.

errors

The error codes defined by the processing steps (spec §7.1.2), verbatim:

Error codeCondition
invalid element stateelement is not a form control, or its form owner is null
invalid argumentBoth card and address provided, or neither provided
unsupported operationThe user agent is unable to perform autofill

Earlier steps can also fail with the generic WebDriver BiDi “trying” errors when the browsing context or shared reference cannot be resolved; those come from the referenced WebDriver BiDi algorithms, not this spec.

Source: spec §7.1.2 (error codes quoted verbatim). Read 2026-10-04.

context and exposure

Not a web-page API: it is a remote-end command available only inside a WebDriver BiDi automation session, defined “for automated testing of autofill functionality” (spec §7). Nothing is exposed to page script; pages only observe the resulting fill and its autofill event.

Source: spec §7. Read 2026-10-04.

lifecycle

Processing steps in order (§7.1.2, condensed): resolve the navigable from context → take its active document, settings and realm → deserialize element → validate it is a form control with a form owner → validate exactly one of card/address → check the user agent can perform autofill → parse the payload → the user agent should autofill element and element’s form owner, while taking into account the contents of parsed card and parsed address → return success. The triggered fill then runs the normal firing model, so the page’s autofill listener and refill() behave exactly as in a user-initiated fill.

Source: spec §7.1.2. Read 2026-10-04.

examples

Both example payloads from the spec, quoted verbatim. Address autofill:

{
  "method": "autofill.trigger",
  "params": {
    "context": "context-id-123",
    "element": { "sharedId": "element-id-456" },
    "address": {
      "fields": [
        { "name": "given-name", "value": "John" },
        { "name": "family-name", "value": "Doe" },
        { "name": "street-address", "value": "123 Main St" },
        { "name": "address-level2", "value": "San Francisco" },
        { "name": "address-level1", "value": "CA" },
        { "name": "postal-code", "value": "94102" },
        { "name": "country", "value": "US" }
      ]
    }
  }
}

Credit-card autofill:

{
  "method": "autofill.trigger",
  "params": {
    "context": "context-id-123",
    "element": { "sharedId": "cc-number-element-id" },
    "card": {
      "number": "4111111111111111",
      "name": "John Doe",
      "expiryMonth": "12",
      "expiryYear": "2028",
      "cvc": "123"
    }
  }
}
Source: spec §7.1 examples, quoted verbatim. Read 2026-10-04.

browser compatibility

Interim table — explicit unknowns. BCD’s webdriver/bidi/ tree has no autofill module file (webdriver/bidi/autofill.json returns 404 while sibling modules like input.json exist; checked 2026-10-04):

Implementationautofill.triggerEvidence
Chrome / chromedriverUnknown — no BCD entry; parent feature experimental behind flag since 146BCD (interface only); ChromeStatus record
Firefox / geckodriverUnknown — no entry; no signal on the parent featuremozilla/standards-positions #1361
Safari / safaridriverUnknown — no entry; no signal on the parent featureWebKit/standards-positions #431
Source: BCD webdriver/bidi absence (checked 2026-10-04); ChromeStatus API record.

security and privacy

The command injects caller-chosen card/address values, bypassing the user-consent gesture that spec §6 expects for real fills — acceptable only because WebDriver BiDi commands run solely in an automation session the user (or CI) explicitly started; no user profile data is read (the test supplies all values). The spec adds no command-specific security text beyond that session boundary (verified 2026-10-04).

Source: spec §7, §6; session model per WebDriver BiDi.

see also