test_selector
Validate UI selectors on real Android devices by testing filter conditions like text, id, type, desc, or clickable. Returns matched controls and their attributes to ensure correct component targeting before coding.
Instructions
在设备上实时测试 Selector 选择器,验证是否能精准匹配到目标控件。 传入过滤条件(text/id/type/desc/clickable),返回匹配到的控件及其完整属性。 用于编写代码前验证 node.Selector().text('xxx').find() 等语句是否能定位到正确控件。 条件可组合使用,如同时指定 text 和 clickable。
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | No | 按文本内容匹配 | |
| id | No | 按资源 ID 匹配,如 'com.tencent.mm:id/xxx' | |
| type | No | 按控件类型匹配,如 'TextView'、'Button'、'ImageView' | |
| desc | No | 按内容描述匹配 | |
| clickable | No | 是否可点击 | |
| mode | No | 检索模式(Android):0=普通,1=复杂,2=简单过滤系统控件 |