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

Đang mở
#570 1 bình luận 0 reaction 1 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@vishnuv688 đang làm issue này rồi.

Từ ngày 10/11/2026.

Đánh giá

Issue này chưa được đánh giá.

Mô tả

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.

Ngôn ngữ chính
TypeScript
Star
10
Fork
4
Merge trung bình
1 ngày 11 giờ
Pull request đã merge (30 ngày)
76

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của webdriverio/devtools

Tất cả issue của webdriverio/devtools

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.