Skip to content

A11y tree is empty in a Python trace: no per-action element snapshots #341

Description

@vishnuv688

Part of #330

A Python trace has no A11y tab content and no element overlay. Measured on two
archives from the same login flow:

frame snapshots *-elements.json resources
JS Selenium 15 12
Python 16 0

The DOM snapshots themselves are there — the tab is empty because nothing
produces the per-action element data beside them. core/action-snapshot.ts
captures it for the JS adapters through core/element-scripts.ts, and
selenium-devtools/src/action-snapshot.ts wires it in; the Python adapter has
no equivalent and never sends one. grep -rn "a11y\|elements.json" over
selenium_devtools/ returns nothing.

What this needs

The element scripts run in the page, so they are not a per-language port —
packages/script is already common to every adapter and the Python adapter
already injects it. What is missing is the adapter-side capture: run the
element-snapshot script per action, and send the result under a scope the
exporter reads. actionSnapshots is a defined TraceLog scope that no adapter
sends today (core synthesizes from command screenshots when it is absent), so
this and #290 are the same shape of gap — a defined scope with no producer.

Whether the capture belongs in the Python adapter or behind the wire follows
the #298 decision: transforms are shared, capture is per-language. Reading the
page needs the live driver, so it stays in-language.

The overlay is a separate, larger gap

The A11y tree is cross-framework in player mode. The overlay — drawing
boxes on the replayed page — is still WDIO-only, and needs per-command locators
plus XPath rather than an elements.json reader. Out of scope here; this issue
covers only the tree.

Acceptance criteria

A Python trace carries *-elements.json beside its frame snapshots, and the
A11y tab renders a tree for a run, matching what the JS Selenium adapter
produces for the same flow.

Size: M. Depends on #288.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions