AirtestProject / AirtestProject/Poco
使用airtestIDE(1.2.13)poco辅助窗进行元素识别以及执行问题
- Dominant language
- Python
- Stars
- 2k
- Forks
- 341
- PR merge metrics
- No merged PRs in 30d
Description
**(重要!问题分类)**
airtestIDE(1.2.13)poco辅助窗元素识别以及执行问题
**描述问题bug**
使用airtestIDE(1.2.13)poco辅助窗有的时候可以识别微信中小程序页面的元素,有的时候不能,测试的微信版本是(7.0.22和8.0.20),已经进行了webview的设置了,即使识别到了微信中的元素编写脚本之后,然后整体执行脚本也还是会报错,识别不到元素
(简洁清晰得概括一下遇到的问题是什么。或者是报错的traceback信息。)使用的pocoui 是 1.0.85,pocoservice-debug.apk是1.0.0.45的。
(在这里粘贴traceback或其他报错信息)
ocalabstract:minitouch_11980
[13:23:54][DEBUG] /Applications/AirtestIDE.app/Contents/MacOS/airtest/core/android/static/adb/mac/adb -P 5037 -s 5TRWUSZL6L75MN4H shell /data/local/tmp/minitouch -n 'minitouch_11980' 2>&1
[13:23:54][DEBUG] [minitouch_server]b'Note: device /dev/input/event4 was outscored by /dev/input/event3 (22062 >= 21010)'
[13:23:54][DEBUG] [minitouch_server]b'Type B touch device vivo_ts (719x1543 with 10 contacts) detected on /dev/input/event3 (score 22062)'
[13:23:54][DEBUG] minitouch header:b'v 1\n^ 10 719 1543 255\n$ 14966\n'
[13:23:54][DEBUG] [minitouch_server]b'Connection established'
[13:24:28][ERROR] Traceback (most recent call last):
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 26, in wrapped
proxy.wait_for_appearance(timeout=proxy.poco._pre_action_wait_for_appearance)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 681, in wait_for_appearance
raise PocoTargetTimeout('appearance', self)
poco.exceptions.PocoTargetTimeout: Waiting timeout for appearance of "UIObjectProxy of "text=商品素材""
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "airtest/cli/runner.py", line 70, in runTest
File "/Users/zhangxiuzhi/java/applet/android-airtest/applet-airtest/applet-pocu.air/applet-pocu.py", line 47, in
poco(text="商品素材").click()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 29, in wrapped
raise e
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 23, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 332, in click
pos_in_percentage = self.get_position(focus)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 613, in get_position
pos = list(map(float, self.attr('pos')))
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 734, in attr
nodes = self._do_query(multiple=False)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 874, in _do_query
raise PocoNoSuchNodeException(self)
poco.exceptions.PocoNoSuchNodeException: Cannot find any visible node by query UIObjectProxy of "text=商品素材"
======================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 26, in wrapped
proxy.wait_for_appearance(timeout=proxy.poco._pre_action_wait_for_appearance)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 681, in wait_for_appearance
raise PocoTargetTimeout('appearance', self)
poco.exceptions.PocoTargetTimeout: Waiting timeout for appearance of "UIObjectProxy of "text=商品素材""
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "airtest/cli/runner.py", line 73, in runTest
File "site-packages/six.py", line 703, in reraise
File "airtest/cli/runner.py", line 70, in runTest
File "/Users/zhangxiuzhi/java/applet/android-airtest/applet-airtest/applet-pocu.air/applet-pocu.py", line 47, in
poco(text="商品素材").click()
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 29, in wrapped
raise e
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 23, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 332, in click
pos_in_percentage = self.get_position(focus)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 613, in get_position
pos = list(map(float, self.attr('pos')))
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 734, in attr
nodes = self._do_query(multiple=False)
File "/Applications/AirtestIDE.app/Contents/MacOS/poco/proxy.py", line 874, in _do_query
raise PocoNoSuchNodeException(self)
poco.exceptions.PocoNoSuchNodeException: Cannot find any visible node by query UIObjectProxy of "text=商品素材"
----------------------------------------------------------------------
Ran 1 test in 50.328s
**预期效果**
(预期想要得到什么、见到什么)
就是可以在微信小程序页面中使用poco进行识别元素并且可以使用python3命令执行.air文件或是可以在airtestIDE中可以整体执行脚本
**相关截图**
(贴出遇到问题时的截图内容,如果有的话)
不能获取到小程序的元素
可以获取到小程序的元素
**python 版本:** `python3.7.0`
**poco 版本:** `1.0.85`
**设备:**
- 型号: V1901A,V2073A
- 系统: 9,11
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.