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

未关闭
#570 1 条评论 0 个 reaction 已指派 1 人 在 GitHub 查看

维护者通常 1 天内回复

@vishnuv688 已经在做这个了。

开始于 2026年11月10日。

评估

这个 Issue 还没有评估数据。

描述

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.

主要语言
TypeScript
星标
10
派生
4
平均合并
1 天 11 小时
30 天内合并 PR
76

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

webdriverio/devtools 的其他 Issue

查看 webdriverio/devtools 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。