AirtestProject / AirtestProject/Poco

POCO在复杂页面找不到元素很长时间都不会报错,一直在重试connectionpool:http://127.0.0.1:14412 "GET /uiautomation/connectionState

Đang mở
#393 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
2k
Fork
341
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**描述问题bug**

在App首页(这个页面树结构比较复杂,poco控件识别的时候也识别到对应的控件),我们使用poco点击二级页面的一个控件(复现一直卡在首页不往下面脚本执行),就会一直提示在连接,不报错。我们想找不到元素一个超时时间就失败,进入except容错的脚本里面继续执行,但是目前一直卡在这里。我找到源码看了一下,有个while循环,我本想计数然后跳出循环的,但是这样好像不能解决实现这条执行脚本报错,往下面继续执行。请帮忙看,我们设置等待控件出现,设置超时时间也是一样的,应该是查找控件的时候就在循环了。
![image](https://user-images.githubusercontent.com/8514029/84742153-a55c9800-afe2-11ea-8dc4-7b7c110047db.png)

```
(在这里粘贴traceback或其他报错信息)
```
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 108
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 146
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 154
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 289
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 108
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 149
DEBUG:urllib3.connectionpool:Starting new HTTP connection (1): 127.0.0.1:19954
DEBUG:urllib3.connectionpool:http://127.0.0.1:19954 "POST / HTTP/1.1" 200 154
**复现步骤**
1.手机停留在APP首页
2.使用POCO点击一个不在该页面的元素
3.运行脚本
4.一直提示连接,有时候几分钟才报错,有时候很久都不报错

**预期效果**
(预期想要得到什么、见到什么)
在页面找不到该控件,或者查找时间超过2分钟(可设置)就失败,不需要一直重启连接,我们最长的连接时间是一直提示这个,如果不去动App切换一个页面就一直提示这个。

**相关截图**
(贴出遇到问题时的截图内容,如果有的话)
![image](https://user-images.githubusercontent.com/8514029/84741340-8d384900-afe1-11ea-8eb5-3b47d0acb405.png)

**python 版本:** `python2.7`

**poco 版本:** `1.0.76
> poco版本通过`pip freeze`可以命令可以查到

**设备:**
- 型号: 华为P20
- 系统: Android 9
- (别的信息)

**其他相关环境信息**
(其他运行环境,例如在linux ubuntu16.04上运行异常,在windows上正常。)
三星 S7相同的脚本,App,WiFi,不会一直在连接,找不到就提示找不到该控件了。

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.