AirtestProject / AirtestProject/Poco

使用下标查询时,会出现很多次空查询

Abierto
#359 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Python
Estrellas
2k
Forks
341
Métricas de merge de PR
Sin PR fusionados en 30 d

Descripción

**(重要!问题分类)**
* 控件识别、树状结构、poco库报错 -> 此仓库

**描述问题bug**
使用下标查询元素时,假设此时child.__len__() = 19 ,那么会产生19次空查询 + 1次正确的查询,总共20次查询

**复现步骤**
脚本内容:

import time
from poco.drivers.std import StdPoco

begtime = time.time()
print(poco("Layout").child("cheatView").offspring("Top_Size_ScrollView_cheat").child("Node_single_input").__len__())
a = poco("Layout").child("cheatView").offspring("Top_Size_ScrollView_cheat").child("Node_single_input")[0].child("TextField_text").exists()
print(a)
print('耗时{}'.format(time.time() - begtime))

**预期效果**
使用下标时正常应该dump一次即可,目前会dump20次

**相关截图**

**python 版本:** `python3.6.6`

**poco 版本:** `1.0.79`

**设备:**
- 型号: [e.g. google pixel 2]
- 系统: [e.g. Android 8.1]
- (别的信息)

**其他相关环境信息**
运行日志输出:
D:\Python36\python.exe E:/debug_poco/ccc.air/ccc.py
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe devices
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe devices
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe -s 03157df3ab476e26 wait-for-device
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe -s 03157df3ab476e26 shell getprop ro.build.version.sdk
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe -s 03157df3ab476e26 forward --no-rebind tcp:19498 tcp:15004
address is ('127.0.0.1', 19498)
[rpc]connected
运行原始build_query方法
Layout {}
and (('attr=', ('name', 'Layout')),)
运行原始build_query方法
cheatView {}
and (('attr=', ('name', 'cheatView')),)
运行原始build_query方法
None {}
and ()
运行原始build_query方法
Top_Size_ScrollView_cheat {}
and (('attr=', ('name', 'Top_Size_ScrollView_cheat')),)
运行原始build_query方法
None {}
and ()
运行原始build_query方法
Node_single_input {}
and (('attr=', ('name', 'Node_single_input')),)
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "326701a0-4bb9-4e56-9a2e-4a66678ba7c9"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.18952393531799316
FrozenUIDumper.getRoot 耗时0.18952393531799316
getRoot 耗时0.18952393531799316
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
19
运行原始build_query方法
Layout {}
and (('attr=', ('name', 'Layout')),)
运行原始build_query方法
cheatView {}
and (('attr=', ('name', 'cheatView')),)
运行原始build_query方法
None {}
and ()
运行原始build_query方法
Top_Size_ScrollView_cheat {}
and (('attr=', ('name', 'Top_Size_ScrollView_cheat')),)
运行原始build_query方法
None {}
and ()
运行原始build_query方法
Node_single_input {}
and (('attr=', ('name', 'Node_single_input')),)
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "988ebe20-7689-4710-8a64-cdc9b842579c"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.22452855110168457
FrozenUIDumper.getRoot 耗时0.22452855110168457
getRoot 耗时0.22502851486206055
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "aa8c7d85-0d35-480c-9568-d6c397335289"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.18102335929870605
FrozenUIDumper.getRoot 耗时0.18102335929870605
getRoot 耗时0.18152332305908203
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "0ac24566-0fc7-408c-a485-f5e7786e0fa8"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.20002532005310059
FrozenUIDumper.getRoot 耗时0.20002532005310059
getRoot 耗时0.20052552223205566
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "6b17bedf-fc94-4eb6-9dbe-bc40b7103db7"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.2020256519317627
FrozenUIDumper.getRoot 耗时0.2020256519317627
getRoot 耗时0.2020256519317627
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "eeaa0a16-8675-45d5-b038-f6b47ddf40be"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.2170274257659912
FrozenUIDumper.getRoot 耗时0.2170274257659912
getRoot 耗时0.2170274257659912
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0005004405975341797
selectImpl 耗时0.0015006065368652344
selectImpl 耗时0.0
selectImpl 耗时0.0015006065368652344
selectImpl 耗时0.0015006065368652344
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "1d60cf35-8a81-41f8-9539-7059d9ce7bb0"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.19902515411376953
FrozenUIDumper.getRoot 耗时0.19902515411376953
getRoot 耗时0.1995251178741455
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "507c7ce3-796e-4ee0-99ec-438db4b11830"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.21452713012695312
FrozenUIDumper.getRoot 耗时0.21452713012695312
getRoot 耗时0.2150273323059082
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "b4cd5265-f462-48cd-913c-5f319a5cf447"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.16402077674865723
FrozenUIDumper.getRoot 耗时0.16402077674865723
getRoot 耗时0.1645209789276123
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "0e2b779d-c433-4370-a508-c9472ee455aa"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.1600203514099121
FrozenUIDumper.getRoot 耗时0.1600203514099121
getRoot 耗时0.1605205535888672
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0014998912811279297
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "17b7c1a6-97c3-43c8-997b-2a2911ba0114"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.21202707290649414
FrozenUIDumper.getRoot 耗时0.21202707290649414
getRoot 耗时0.21252703666687012
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "8fc845d3-5d81-4d13-a1f5-937474aa6770"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.1955249309539795
FrozenUIDumper.getRoot 耗时0.1955249309539795
getRoot 耗时0.1955249309539795
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "80dc46c9-5d7c-41f6-8bba-677bc9fe6664"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.20752644538879395
FrozenUIDumper.getRoot 耗时0.20752644538879395
getRoot 耗时0.20802664756774902
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0014998912811279297
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "85e82b89-f382-4705-8470-dec1bdbc9e3f"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.27953577041625977
FrozenUIDumper.getRoot 耗时0.27953577041625977
getRoot 耗时0.28003597259521484
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "0311671a-2523-45bb-ad2f-b50d2a08523c"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.3910496234893799
FrozenUIDumper.getRoot 耗时0.3910496234893799
getRoot 耗时0.3910496234893799
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0
selectImpl 耗时0.0014998912811279297
selectImpl 耗时0.0014998912811279297
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "ecee0f6f-dab1-440d-a724-7c3343c338b5"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.2150275707244873
FrozenUIDumper.getRoot 耗时0.2150275707244873
getRoot 耗时0.2150275707244873
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "b6baf050-6f1a-4b34-9539-33220ad6ddcd"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.20302557945251465
FrozenUIDumper.getRoot 耗时0.20302557945251465
getRoot 耗时0.20352578163146973
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0015003681182861328
selectImpl 耗时0.0015003681182861328
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "87234bf8-1c92-4550-9943-41af2a2732e4"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.19652462005615234
FrozenUIDumper.getRoot 耗时0.19652462005615234
getRoot 耗时0.19702482223510742
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "6eb79008-877b-4538-a476-eb99f75deaf5"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.2150275707244873
FrozenUIDumper.getRoot 耗时0.21552753448486328
getRoot 耗时0.21552753448486328
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.002000093460083008
selectImpl 耗时0.002000093460083008
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "0d3d9302-5dae-4135-9547-bd388f4fffbc"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.1755223274230957
FrozenUIDumper.getRoot 耗时0.1755223274230957
getRoot 耗时0.1755223274230957
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "4425db73-560b-413d-87ee-f66e4bc1b2fd"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.21452736854553223
FrozenUIDumper.getRoot 耗时0.21452736854553223
getRoot 耗时0.21452736854553223
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0
selectImpl 耗时0.0009999275207519531
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
运行原始build_query方法
TextField_text {}
and (('attr=', ('name', 'TextField_text')),)
运行原始build_query方法
None {}
and ()
send msg is b'd\x00\x00\x00{"method": "Dump", "params": [true], "jsonrpc": "2.0", "id": "ea3dc3e3-48c4-40e3-8234-7ae875813216"}'
msg len is 77087
sync_wrapper cb.wait 耗时0.16852140426635742
FrozenUIDumper.getRoot 耗时0.16852140426635742
getRoot 耗时0.1690213680267334
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0
selectImpl 耗时0.0004999637603759766
selectImpl 耗时0.0005002021789550781
selectImpl 耗时0.0010001659393310547
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0015001296997070312
selectImpl 耗时0.0
selectImpl 耗时0.0015001296997070312
True
耗时4.667592525482178
E:\debug_poco\lib\airtest\core\android\static\adb\windows\adb.exe -s 03157df3ab476e26 forward --remove tcp:19498

进程已结束,退出代码0

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.