AirtestProject / AirtestProject/AirtestIDE

poco定位微信小程序页面元素 同样的元素脚本 有时间定位成功有时候会失败 尝试卸载重装pocoservice后又可以了 但运行一段时间后不行了 设备系统Android10

Open
#968 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
236
Forks
40
PR merge metrics
No merged PRs in 30d

Description

(请尽量按照下面提示内容填写,有助于我们快速定位和解决问题,感谢配合。**否则直接关闭。**)

**(重要!根据问题类型选择分类)**
* 控件识别、树状结构、poco库报错 -> https://github.com/AirtestProject/Poco/issues

**详细描述问题bug:**
bug描述
同样的脚本 有时候运行时可以找元素 用例正常 但是有时候又找不到元素 可以确定脚本定位的元素没问题 在airtest ide上面有试过。

**复现步骤:**
有留意过一个现象 执行成功的时候 设备上进入小程序页面会浮现poco的提示语 执行失败的时候没有出现poco

**python 版本:** `python3.9`

**操作系统:** `mact`

**手机设备信息:**
- 手机型号:华为 Mate10
- Android系统版本号: Android10
- (别的信息)

**其他相关信息补充**
- AirtestIDE版本号:1.2.9
- 尝试卸载重新安装pocoSevices后一段时间又正常可以了,但是运行一段时间后又不行了

**截屏**
强烈建议带上截图,包括IDE本身的截图和后面的黑窗口的报错信息的截图(尽量完整)。
![image](https://user-images.githubusercontent.com/52486139/123214926-6668f880-d4fa-11eb-8ca6-283b04c6b49b.png)
Testing started at 2:38 下午 ...
/usr/local/bin/python3.9 /Applications/PyCharm.app/Contents/plugins/python/helpers/pycharm/_jb_unittest_runner.py --path /Users/supermonkey/AirtestProject/test_caes/test_recommend.py
Launching unittests with arguments python -m unittest /Users/supermonkey/AirtestProject/test_caes/test_recommend.py in /Users/supermonkey/AirtestProject/test_caes

[14:38:12][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 wait-for-device
[14:38:12][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell getprop ro.build.version.sdk
[14:38:12][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys activity top
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys package com.netease.open.pocoservice
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys package com.netease.open.pocoservice.test
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 forward --no-rebind tcp:19088 tcp:10080
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 forward --no-rebind tcp:17132 tcp:10081
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell ps -A |echo $(grep -E com.github.uiautomator)
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell am force-stop com.netease.open.pocoservice
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell am start -n com.netease.open.pocoservice/.TestActivity
[14:38:13][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell am instrument -w -e debug false -e class com.netease.open.pocoservice.InstrumentedTestAsLauncher com.netease.open.pocoservice.test/android.support.test.runner.AndroidJUnitRunner
[14:38:15][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell monkey -p com.tencent.mm -c android.intent.category.LAUNCHER 1
/Users/supermonkey/AirtestProject/common/base_page.py:60: ResourceWarning: unclosed file <_io.TextIOWrapper name='/Users/supermonkey/AirtestProject/outputs/log/21-06-24.log' mode='a' encoding='utf-8'>
LogHandler(file=log_path).info("在{}页面查找{}元素".format(img_name, locator))
ResourceWarning: Enable tracemalloc to get the object allocation traceback
[14:38:16][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell ls -l /data/local/tmp/rotationwatcher.jar
[14:38:16][DEBUG] install_rotationwatcher skipped
[14:38:16][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell app_process -Djava.class.path=/data/local/tmp/rotationwatcher.jar /data/local/tmp com.example.rotationwatcher.Main
[14:38:16][DEBUG] [rotation_server]b'0'
[14:38:18][INFO] update orientation None->0
[14:38:18][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys display
[14:38:18][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys SurfaceFlinger
[14:38:18][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell getevent -p
[14:38:18][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell ls -l /data/local/tmp/maxpresent.jar
[14:38:18][DEBUG] install_maxtouch skipped
[14:38:18][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys display
[14:38:19][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell dumpsys SurfaceFlinger
[14:38:19][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell getevent -p
[14:38:19][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 forward --no-rebind tcp:19899 localabstract:maxpresent_19899
[14:38:19][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell app_process -Djava.class.path=/data/local/tmp/maxpresent.jar /data/local/tmp com.netease.maxpresent.MaxPresent socket maxpresent_19899
[14:38:19][DEBUG] [airtouch_server]b'Metrics Message : 1920.0=====1080.0'
[14:38:19][DEBUG] [airtouch_server]b'Start local socket (maxpresent_19899) server...'
[14:40:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 shell am force-stop com.tencent.mm

Error
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/case.py", line 59, in testPartExecutor
yield
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/case.py", line 593, in run
self._callTestMethod(testMethod)
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/unittest/case.py", line 550, in _callTestMethod
method()
File "/Users/supermonkey/AirtestProject/test_caes/test_recommend.py", line 36, in test_case
self.assertEqual(AUserRecommendationPaga(self.poco).select_good_lessons_get_text(),"精选好课")
File "/Users/supermonkey/AirtestProject/pageobject/A_user_recommendation_page.py", line 119, in select_good_lessons_get_text
self.init_element(self.select_good_lessons,"推荐课表页").wait_for_appearance()
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/poco/proxy.py", line 681, in wait_for_appearance
raise PocoTargetTimeout('appearance', self)
poco.exceptions.PocoTargetTimeout: Waiting timeout for appearance of "UIObjectProxy of "text=精选好课""

Assertion failed
只执行一次

Ran 1 test in 134.173s

FAILED (errors=1)
[14:40:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 forward --remove tcp:19088
[14:40:26][DEBUG] /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/airtest/core/android/static/adb/mac/adb -P 5037 -s UYT5T18524015578 forward --remove tcp:19899
[14:40:26][DEBUG] [rotation_server]b''
[14:40:26][DEBUG] [airtouch_server]b''

Process finished with exit code 1

Assertion failed

Assertion failed

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.