Python: capture the native element tree per action in trace mode

Aperta
#570 1 commento 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@vishnuv688 ci sta già lavorando.

Dal 10/11/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

What

On a native Appium session, the Python adapter's trace actions carry a screenshot and nothing else: no element list, no locators, an empty A11y tab. The WebdriverIO service, Selenium (Node.js) and Nightwatch read the app's page source on every native action capture in trace mode (webdriverio/devtools#569 for the latter two), so their native traces carry the element tree. Python is the one ✕ in the capability matrix's "Native app element list and accessibility tree per action (trace mode)" row.

Why it happens

instrumentation.py takes no per-action snapshot on a native app: the action-snapshot path is gated off for native sessions, so only the row screenshot is recorded and no page source is read.

What a fix needs

  • Read GET /session/:id/source on each capturing command of a native session in trace mode, through the guarded executor so it renders no row and lands in no wait poll.
  • Build the snapshot text and element locators from it. Core's fromPageSource (serializeMobileSnapshot plus generateAllElementLocators) does this in TypeScript; Python cannot import core, so either mirror it (with mirror-vectors.json cases) or have the backend build it, as it already does for other trace content Python cannot produce.
  • Take the platform from the session capabilities (platformName, flat or under appium:options), as core's nativeAppOf does.
  • Skip a webview's HTML page source, as #569 does.
  • Time it as the pageSource probe under DEVTOOLS_CAPTURE_TIMING=1; it is the costly part of a native capture, most of it on iOS (#516).
  • Flip the Python cell in packages/conformance/src/features.ts, regenerate the README and docs-site tables.

Follow-up from #516 / #563.

Lingua principale
TypeScript
Stelle
10
Fork
4
Merge medio
1g 11h
PR unite (30g)
76

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di webdriverio/devtools

Tutte le issue di webdriverio/devtools

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.