fix: tap_text UI 树命中路径——u2 3.x 的 el.bounds 是方法不是属性,取 bounds 抛 TypeError 被吞导致永远走 OCR 兜底;改兼容写法
This commit is contained in:
+2
-1
@@ -563,7 +563,8 @@ def api_screen_tap_text():
|
||||
try:
|
||||
el = d(**kw)
|
||||
if el.exists(timeout=1.5):
|
||||
b = el.bounds
|
||||
# u2 版本差异:3.x 部分版本 bounds 是方法(el.bounds())
|
||||
b = el.bounds() if callable(el.bounds) else el.bounds
|
||||
el.click()
|
||||
return jsonify({"ok": True, "found": True, "method": "ui",
|
||||
"matched": text,
|
||||
|
||||
Reference in New Issue
Block a user