pocoui包已经安装,且usb连接已打开设备连接,cmd中运行adb devices可以正常检测设备,但是运行结果报如下异常,异常中的G未被赋值,请教下是安装配置问题还是其他原因,烦请指点,感谢!
运行环境:win 10,pocoui版本:1.0.78, python版本:3.7
Traceback (most recent call last):
File "D:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1758, in
main()
File "D:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1752, in main
globals = debugger.run(setup['file'], None, None, is_module)
File "D:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev\pydevd.py", line 1147, in run
pydev_imports.execfile(file, globals, locals) # execute the script
File "D:\Program Files\JetBrains\PyCharm Community Edition 2019.1.2\helpers\pydev_pydev_imps_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "E:/python_workspace/python_study/pocoui/east_news.py", line 531, in
dftt.run()
File "E:/python_workspace/python_study/pocoui/east_news.py", line 58, in run
home()
File "D:\Program Files\python3.7\lib\site-packages\airtest\utils\logwraper.py", line 78, in wrapper
res = f(*args, **kwargs)
File "D:\Program Files\python3.7\lib\site-packages\airtest\core\api.py", line 242, in home
G.DEVICE.home()
AttributeError: 'NoneType' object has no attribute 'home'
我也遇到了这个,然后我的手机是vivo Android。注释掉home后又出现stop_app出错。然后把stop_app注释掉后就会出现等待广告元素异常,然后就被异常退出。
等待广告元素异常
Waiting timeout for appearance of "UIObjectProxy of "com.songheng.eastnews:id/aoy""
Traceback (most recent call last):
File "C:/Users/26879/Desktop/yangmao/%E4%B8%9C%E6%96%B9%E5%A4%B4%E6%9D%A1/东方头条.py", line 545, in
dftt.run()
File "C:/Users/26879/Desktop/yangmao/%E4%B8%9C%E6%96%B9%E5%A4%B4%E6%9D%A1/东方头条.py", line 77, in run
self.__pre_and_skip_ads()
File "C:/Users/26879/Desktop/yangmao/%E4%B8%9C%E6%96%B9%E5%A4%B4%E6%9D%A1/东方头条.py", line 441, in pre_and_skip_ads
poco('com.songheng.eastnews:id/g').wait_for_appearance(120)
File "E:\venv\yangmao\lib\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 "com.songheng.eastnews:id/g""
[09:55:16][DEBUG]<airtest.core.android.adb> E:\venv\yangmao\lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 28e4e44d forward --remove tcp:15739
[09:55:16][DEBUG]<airtest.core.android.adb> E:\venv\yangmao\lib\site-packages\airtest\core\android\static\adb\windows\adb.exe -s 28e4e44d forward --remove tcp:19755
Process finished with exit code 1