AirtestProject / Poco

A cross-engine test automation framework based on UI inspection
http://airtest.netease.com/
Apache License 2.0
1.77k stars 318 forks source link

鸿蒙系统输入交易密码弹出安全键盘之后连接关闭报错:OSError: socket connection broken #562

Open dananxiaonan opened 2 years ago

dananxiaonan commented 2 years ago

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

(重要!问题分类)

描述问题bug (简洁清晰得概括一下遇到的问题是什么。或者是报错的traceback信息。) 鸿蒙系统执行输入交易密码的自动化脚本时,airtestIDE与手机连接自动关闭并报错: Error Traceback (most recent call last): File "C:\WRN\MobileBank\utils\utils.py", line 82, in wraper test_share_try(args) File "C:\WRN\MobileBank\test_case\android_case\mobile_2_android_comlete_account_show.air\mobile_2_android_comlete_account_show.py", line 45, in test_comlete_account_show poco(text="1").click() File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\poco\proxy.py", line 23, in wrapped return func(proxy, *args, kwargs) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\poco\proxy.py", line 334, in click ret = self.poco.click(pos_in_percentage) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\poco\pocofw.py", line 252, in click ret = self.agent.input.click(pos[0], pos[1]) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\poco\utils\airtest\input.py", line 81, in click touch(pos, duration=self.default_touch_down_duration) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper res = f(*args, *kwargs) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\api.py", line 355, in touch try_log_screen() File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper res = f(args, kwargs) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\cv.py", line 106, in try_log_screen screen = G.DEVICE.snapshot(quality=quality) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\android.py", line 407, in snapshot screen = self.screen_proxy.snapshot(ensure_orientation=ensure_orientation) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\cap_methods\base_cap.py", line 42, in snapshot screen = self.get_frame_from_stream() File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\cap_methods\javacap.py", line 111, in get_frame_from_stream return self.frame_gen.send(None) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\threadsafe.py", line 27, in send return self.it.send(*args) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\cap_methods\javacap.py", line 84, in get_frames header = s.recv(4) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\safesocket.py", line 44, in recv raise socket.error("socket connection broken") OSError: socket connection broken

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\ddt.py", line 220, in wrapper return func(self, *args, kwargs) File "C:\WRN\MobileBank\utils\utils.py", line 87, in wraper return_home_base(mobile_type) File "C:\WRN\MobileBank\utils\utils.py", line 69, in return_home_base returnHOME() File "C:\WRN\MobileBank\utils\utils.py", line 37, in returnHOME while exists(Template(r"tpl1661733010526.png", record_pos=(-0.44, -0.919), resolution=(1080, 2280))) or exists(Template(r"tpl1661752140256.png", record_pos=(-0.436, -0.931), resolution=(1080, 2280))): File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper res = f(*args, *kwargs) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\api.py", line 617, in exists pos = loop_find(v, timeout=ST.FIND_TIMEOUT_TMP) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\logwraper.py", line 90, in wrapper res = f(args, kwargs) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\cv.py", line 62, in loop_find screen = G.DEVICE.snapshot(filename=None, quality=ST.SNAPSHOT_QUALITY) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\android.py", line 407, in snapshot screen = self.screen_proxy.snapshot(ensure_orientation=ensure_orientation) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\cap_methods\base_cap.py", line 42, in snapshot screen = self.get_frame_from_stream() File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\core\android\cap_methods\javacap.py", line 111, in get_frame_from_stream return self.frame_gen.send(None) File "C:\WRN\anaconda\envs\airtest_py3.6\lib\site-packages\airtest\utils\threadsafe.py", line 27, in send return self.it.send(*args) StopIteration

(在这里粘贴traceback或其他报错信息)

复现步骤

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

预期效果 (预期想要得到什么、见到什么) 能够正常输入交易密码 相关截图 (贴出遇到问题时的截图内容,如果有的话)

python 版本: python3.6

poco 版本: 1.0.69

poco版本通过pip freeze可以命令可以查到

设备:

其他相关环境信息 (其他运行环境,例如在linux ubuntu16.04上运行异常,在windows上正常。)