帮助中心
当前位置: 首页 > 帮助中心 > 公开AIP接口
各类元素识别接口-查找元素
发布日期:2022-06-28阅读次数:0

1.查找元素

名称

必选

类型

说明

Action

FindObj

String

任务值不可更改

Text

文本内容

String

查找的文本内容

ResourceId

元素ID

String

多个ID可以用“|”符号隔开

ContentDesc

元素内容

String

是否包含查找

IsExact

是否精准查找

Bool

精准查找需要完全一样

UiClass

元素类名

String

UI元素的类名

Regex

正则表达式

String

可基于正则查找

Devices

Device[]

Device[]

要执行的手机

 

发送示例:

{

"Action": "FindObj",

"Text": "你好",

"ResourceId": null,

"ContentDesc": null,

"IsExact": true,

"UiClass": null,

"Regex": null,

"Devices": [

             {

                "Key":"1095cc81"

             },

             {

                "Key":"10a5cc1c"

             }

             ]

}

返回Json值:

{

"Action":"FindObj",

"Success":true,//执行成功

"Devices":[

             {

              "Key":"1095cc81",//手机序列号

               "ObjInfo":{

                         "content_desc":"主题",

                         "exact":true,

                         "focused":false,

                          "index":0,

                         "list_text":["主题"],

                          "nodes":

                            [

                              {

                                 "text":"主题",

                                 "className":"android.widget.TextView",

                                 "packageName":"com.huawei.android.launcher",

                                 "hintText":"null",

                                 "left":792,

                                 "bottom":1278,

                                 "right":1044,

                                 "top":984,

                                 "visible_to_user":true

                                      }

                                   ]

                                }

               "IsDone":true,//手机执行任务完成

             },

             {

              "Key":"10a5cc1c",//手机序列号       

               "ObjInfo":.....,//获取到的元素内容

               "IsDone":true,//手机执行任务完成

              }

          ]

 

}