最近使用 Appium 做一些 Android UI 自动化,发现一些页面的控件查找等操作都非常费时间,查找要 20 秒,执行 click 操作要 10 秒。页面本身也不复杂,没有很多控件。请问有没有遇到过类似情况的,是什么原因呢?谢谢!

Appium 版本 1.4.13 OSX 版

下面是 Appium 的日志:

info: --> POST /wd/hub/session/74dd67e4-acaa-4b2f-ae6b-143396516d38/element {"using":"name","sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38","value":"1"}
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue: ["find",{"strategy":"name","selector":"1","context":"","multiple":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"name","selector":"1","context":"","multiple":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding 1 using NAME with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[DESCRIPTION=1, INSTANCE=0]

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[TEXT=1, INSTANCE=0]

info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":{"ELEMENT":"10"}}

info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"10"},"sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38"}
info: <-- POST /wd/hub/session/74dd67e4-acaa-4b2f-ae6b-143396516d38/element 200 20140.723 ms - 88 {"status":0,"value":{"ELEMENT":"10"},"sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38"}

info: --> POST /wd/hub/session/74dd67e4-acaa-4b2f-ae6b-143396516d38/element/10/click {"sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38","id":"10"}
info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"10"}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"10"}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: click

info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}

info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38"}
info: <-- POST /wd/hub/session/74dd67e4-acaa-4b2f-ae6b-143396516d38/element/10/click 200 10154.573 ms - 76 {"status":0,"value":true,"sessionId":"74dd67e4-acaa-4b2f-ae6b-143396516d38"}


↙↙↙阅读原文可查看相关链接,并与作者交流