AirtestProject / AirtestProject/Poco

能否实现定位滑动选择器的具体选项

Open
#292 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Python
Stars
2k
Forks
341
PR merge metrics
No merged PRs in 30d

Description

比如以下这个滑动选择器
![滑动选择器](https://user-images.githubusercontent.com/48904314/66743198-f7757880-eeab-11e9-94fd-ec87bf0e8ee7.png)

Android最细只能识别到整个竖列选择的区域,无法识别具体的选项,但是可以通过swipe()来滑动选择
![Android的UI树](https://user-images.githubusercontent.com/48904314/66741429-1b36bf80-eea8-11e9-8809-7a974bac07c2.png)

iOS的UI树可以细化到选择器的具体选项
![iOS的UI树](https://user-images.githubusercontent.com/48904314/66744266-913e2500-eeae-11e9-969f-08a2f08703e1.png)

但是:
1、poco(nameMatches="^.*Picker.*$").child(nameMatches="^.*PickerWheel.*$")[0].child(nameMatches="^.*Other.*$")[1].click()运行成功却没有生效(北京是第一个选项对应应该是child(nameMatches="^.*Other.*$")[0],child(nameMatches="^.*Other.*$")[1]应该对应天津,如果生效应该是到天津,但是运行完该语句日志显示OK,选项选中却还是北京);
2、使用"Poco Auto Recording"直接点击天津录制脚本得到语句poco(value="天津").click(),运行失败提示找不到节点;
3、使用swipe()函数移动选择器,poco("Picker").child("PickerWheel")[0].swipe([0,-0.028])运行完成选择器纹丝不动,poco("Picker").child("PickerWheel")[0].swipe([0,-0.029])运行完成选择器从第1个选项一下子跳到第8个选项。swipe()函数使用很不友好,不确定是ide的问题还是iOS控件的问题

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.