AirtestProject / AirtestProject/Poco

Error in AirtestIDE20 \ poco \ sdk \ Selector.py

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

**Describe the bug**
Exceptions are being processed at the time of another exception.
```
`[Start running..]
save log in 'C:/AirtestIDE20/AirtestLog\4291660d4891d5bc2ea0574442029ffa'
[rpc]connected
[rpc]connected
======================================================================
ERROR: runTest (app.widgets.code_runner.ide_launcher.AirtestIDECase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\AirtestIDE20\poco\sdk\Selector.py", line 137, in selectImpl
result = [self.selectImpl(cond, multiple, root, maxDepth, onlyVisibleNode, includeRoot)[i]]
IndexError: list index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "airtest\cli\runner.py", line 65, in runTest
File "site-packages\six.py", line 693, in reraise
File "airtest\cli\runner.py", line 61, in runTest
File "C:\Users\wazzapps_user\Desktop\untitled.air\untitled.py", line 23, in
merge(dnk)
File "C:\Users\wazzapps_user\Desktop\untitled.air\untitled.py", line 18, in merge
cat[i].focus('center').drag_to(cat[len(cat)-i-1], duration=0.2)
File "C:\AirtestIDE20\poco\proxy.py", line 246, in __getitem__
pos = uiobj.get_position()
File "C:\AirtestIDE20\poco\proxy.py", line 72, in wrapped
return func(proxy, *args, **kwargs)
File "C:\AirtestIDE20\poco\proxy.py", line 613, in get_position
pos = self.attr('pos')
File "C:\AirtestIDE20\poco\proxy.py", line 39, in wrapped
return func(self, *args, **kwargs)
File "C:\AirtestIDE20\poco\proxy.py", line 734, in attr
nodes = self._do_query(multiple=False)
File "C:\AirtestIDE20\poco\proxy.py", line 872, in _do_query
self._nodes = self.poco.agent.hierarchy.select(self.query, multiple)
File "C:\AirtestIDE20\poco\freezeui\hierarchy.py", line 90, in select
return self.selector.select(query, multiple)
File "C:\AirtestIDE20\poco\sdk\Selector.py", line 78, in select
return self.selectImpl(cond, multiple, self.getRoot(), 9999, True, True)
File "C:\AirtestIDE20\poco\sdk\Selector.py", line 140, in selectImpl
u'Query results index out of range. Index={} condition "{}" from root "{}".'.format(i, cond, root))
poco.sdk.exceptions.NoSuchTargetException: Query results index out of range. Index=1 condition "('and', (('attr=', ('texture', '0')),))" from root "".

----------------------------------------------------------------------
Ran 1 test in 1.319s

FAILED (errors=1)
[Finished]`
```

**To Reproduce**
I use this script:
```
`from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()

dnk=poco(texture="0")
def merge(cat):
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()
if len(cat) > 1:
for i in range(0, len(cat)):
cat[i].focus('center').drag_to(cat[len(cat)-i-1], duration=0.2)
from poco.drivers.unity3d import UnityPoco
poco = UnityPoco()

merge(dnk)`
```

** Expected behavior **
Characters in the game must move to other similar characters.

** python version: ** `python3.6`

** poco version: ** `1.0.76`

** Smartphone (please complete the following information): **
On all the devices that I managed to use.
About 5 pieces

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.