AirtestProject / AirtestProject/Poco

控件树不刷新,抓控件就会报错

Đang mở
#448 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ả

**(问题分类)**
* 控件识别、树状结构、poco库报错

**描述问题bug**
(控件树不刷新,抓控件就会报错)

```
'extra': {'sys.argv': ["'D:\\Program Files\\AirtestIDE\\AirtestIDE.exe'"]},
'level': 40,
'message': "TypeError: unsupported operand type(s) for -: 'str' and 'float'",
'modules': {'python': '3.6.8'},
'platform': 'python',
'project': '3',
'release': '1.2.8',
'server_name': 'AirtestIDE',
'tags': {'bit': '64bit', 'debug': 'RELEASE', 'platform': 'Windows'},
'time_spent': None,
'timestamp': '2021-03-24T02:53:13Z'} File "app\plugins\poco\poco_window.py", line 711, in getTargetPayload

File "app\plugins\poco\poco_assistant.py", line 102, in locateTargetRect
["TypeError: unsupported operand type(s) for -: 'str' and 'float'", ' File "app\\plugins\\poco\\poco_window.py", line 527, in pocoMouseMove', ' File "app\\plugins\\poco\\poco_window.py", line 711, in getTargetPayload', ' File "app\\plugins\\poco\\poco_assistant.py", line 102, in locateTargetRect', ' File "app\\plugins\\poco\\poco_assistant.py", line 140, in getPayload', ' File "app\\plugins\\poco\\poco_assistant.py", line 140, in getPayload', ' File "app\\plugins\\poco\\poco_assistant.py", line 140, in getPayload', ' File "app\\plugins\\poco\\poco_assistant.py", line 136, in getPayload', ' File "app\\plugins\\poco\\poco_assistant.py", line 86, in checkPointInRect']
File "app\plugins\poco\poco_assistant.py", line 140, in getPayload
File "app\plugins\poco\poco_assistant.py", line 140, in getPayload
File "app\plugins\poco\poco_assistant.py", line 140, in getPayload
File "app\plugins\poco\poco_assistant.py", line 136, in getPayload
File "app\plugins\poco\poco_assistant.py", line 86, in checkPointInRect
TypeError: unsupported operand type(s) for -: 'str' and 'float'

Traceback (most recent call last):
File "app\plugins\poco\poco_window.py", line 341, in refreshData
File "app\plugins\poco\gui\tree.py", line 519, in loadData
File "app\plugins\poco\gui\tree.py", line 477, in checkDiffData
File "app\plugins\poco\gui\tree.py", line 471, in calHashWithTree
File "app\plugins\poco\gui\tree.py", line 471, in calHashWithTree
File "app\plugins\poco\gui\tree.py", line 471, in calHashWithTree
File "app\plugins\poco\gui\tree.py", line 468, in calHashWithTree
File "app\plugins\poco\gui\tree.py", line 461, in calHashWithPos
TypeError: type str doesn't define __round__ method
Refresh error!
poco_data: D:\Program Files\AirtestIDE\refresh_error_data.json

以下是exception的部分内容:
{'abs_path': 'app\\plugins\\poco\\poco_assistant.py',
'filename': 'app\\plugins\\poco\\poco_assistant.py',
'function': 'checkPointInRect',
'lineno': 86,
'module': 'app.plugins.poco.poco_assistant',
'vars': {'a_pos': [0.5,
0.5],
'ax': 0.5,
'ay': 0.5,
'h': 0.181481481,
'pos': [0.5579817905918057,
0.3563581183611533],
'pt_pos': ["'NaN'",
"'NaN'"],
'pt_x': "'NaN'",
'pt_y': "'NaN'",
'self': '',
'size': [0.5925926,
0.181481481],
'w': 0.5925926,
'x': 0.5579817905918057,
'y': 0.3563581183611533}}]},
'type': 'TypeError',
'value': "unsupported operand type(s) for -: 'str' "
"and 'float'"}]}
```

**复现步骤**
1.打开游戏
2.抓取控件

**预期效果**
控件树能按刷新时间刷新,能正常抓取控件

**python 版本:** `python2.7`
airtest自带的python环境

**poco 版本:** `1.0.69`

**设备:**
- 型号: [小米 mix 2s]
- 系统: [Android 9]

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.