Poco
Poco copied to clipboard
使用airtestIDE(1.2.13)poco辅助窗进行元素识别以及执行问题
(重要!问题分类) 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]<airtest.core.android.adb> /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]<airtest.utils.nbsp> [minitouch_server]b'Note: device /dev/input/event4 was outscored by /dev/input/event3 (22062 >= 21010)' [13:23:54][DEBUG]<airtest.utils.nbsp> [minitouch_server]b'Type B touch device vivo_ts (719x1543 with 10 contacts) detected on /dev/input/event3 (score 22062)' [13:23:54][DEBUG]<airtest.core.android.touch_methods.minitouch> minitouch header:b'v 1\n^ 10 719 1543 255\n$ 14966\n' [13:23:54][DEBUG]<airtest.utils.nbsp> [minitouch_server]b'Connection established' [13:24:28][ERROR]<airtest.core.api> 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
====================================================================== 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
Ran 1 test in 50.328s
预期效果
(预期想要得到什么、见到什么)
就是可以在微信小程序页面中使用poco进行识别元素并且可以使用python3命令执行.air文件或是可以在airtestIDE中可以整体执行脚本
相关截图
(贴出遇到问题时的截图内容,如果有的话)
不能获取到小程序的元素

python 版本: python3.7.0
poco 版本: 1.0.85
设备:
- 型号: V1901A,V2073A
- 系统: 9,11
整体执行的脚本:
-- encoding=utf8 --
from airtest.core.api import * from poco.proxy import UIObjectProxy
auto_setup(file)
from poco.drivers.android.uiautomation import AndroidUiautomationPoco poco = AndroidUiautomationPoco(use_airtest_input=True, screenshot_each_action=False)
stop_app("com.tencent.mm") start_app("com.tencent.mm") sleep(4) poco(text="发现").click() sleep(1) poco(text="小程序").click() sleep(1) poco(text="美团优选团长端").click() sleep(20) poco(text="商品素材").click() stop_app("com.tencent.mm")