具体表现:
1、click 要等个 20 多秒才点击,send_keys 动作甚至要 1 份多钟!简直了无语了!!
2.、登录的时候不会,就是登录进去之后就变慢了!
3、真机和模拟器都是如此!
4、排除是 xpath 问题,用其他选择器也是如此!

我的环境是 Python3.5+appium1.7.1,我就纳闷了!运行其他 app 都不会这样,是不是和 appium 交互有关系??我又不会看日志...

代码:

appium 日志(只截取了登录进去后的):
[HTTP] --> POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element {"sessionId":"a606c76b-ca83-4692-a8b3-5a0feaa910d1","value":"//android.widget.TextView[@text='']","using":"xpath"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//android.widget.TextView[@text='']","a606c76b-ca83-4692-a8b3-5a0feaa910d1"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 20000 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[@text='']' using 'XPATH' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[@text='']' using 'XPATH' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[AndroidBootstrap] Received command result from bootstrap
[BaseDriver] Waited for 214 ms so far
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[@text='']","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding '//android.widget.TextView[@text='']' using 'XPATH' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=46]
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"7"}}
[MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"7"}
[HTTP] <-- POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element 200 11026 ms - 87
[HTTP] --> POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element/7/click {"sessionId":"a606c76b-ca83-4692-a8b3-5a0feaa910d1","id":"7"}
[MJSONWP] Calling AppiumDriver.click() with args: ["7","a606c76b-ca83-4692-a8b3-5a0feaa910d1"]
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:click","params":{"elementId":"7"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"7"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element/7/click 200 10303 ms - 76
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":true}
[HTTP] --> POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element {"sessionId":"a606c76b-ca83-4692-a8b3-5a0feaa910d1","value":"text(\"朋友圈\")","using":"-android uiautomator"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["-android uiautomator","text(\"朋友圈\")","a606c76b-ca83-4692-a8b3-5a0feaa910d1"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 20000 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"-android uiautomator","selector":"text(\"朋友圈\")","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"-android uiautomator","selector":"text(\"朋友圈\")","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'text("朋友圈")' using 'ANDROID_UIAUTOMATOR' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: text("朋友圈")
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] UiSelector coerce type: class java.lang.String arg: "朋友圈"
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[TEXT=朋友圈]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"8"}}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"8"}
[HTTP] <-- POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element 200 10051 ms - 87
[HTTP] --> POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element/8/click {"sessionId":"a606c76b-ca83-4692-a8b3-5a0feaa910d1","id":"8"}
[MJSONWP] Calling AppiumDriver.click() with args: ["8","a606c76b-ca83-4692-a8b3-5a0feaa910d1"]
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:click","params":{"elementId":"8"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"8"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":true}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/a606c76b-ca83-4692-a8b3-5a0feaa910d1/element/8/click 200 10177 ms - 76
[BaseDriver] Shutting down because we waited 60 seconds for a command
[AndroidDriver] Shutting down Android driver
[Appium] Closing session, cause was 'New Command Timeout of 60 seconds expired. Try customizing the timeout using the 'newCommandTimeout' desired capability'
[Appium] Removing session a606c76b-ca83-4692-a8b3-5a0feaa910d1 from our master session list
[ADB] Getting connected devices...
[ADB] 2 device(s) connected
[ADB] Running 'D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62025","shell","am","force-stop","cn.lehealth.lemovt"]
[ADB] Pressing the HOME button
[ADB] Getting connected devices...
[ADB] 2 device(s) connected
[ADB] Running 'D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62025","shell","input","keyevent",3]
[AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1

[AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0

[AndroidBootstrap] Received command result from bootstrap
[UiAutomator] Shutting down UiAutomator
[UiAutomator] Moving to state 'stopping'
[UiAutomator] UiAutomator shut down normally
[UiAutomator] Moving to state 'stopped'
[ADB] Attempting to kill all uiautomator processes
[ADB] Getting all processes with uiautomator
[ADB] Getting connected devices...
[ADB] 2 device(s) connected
[ADB] Running 'D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62025","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[UiAutomator] Moving to state 'stopped'
[Logcat] Stopping logcat capture
[ADB] Getting connected devices...
[ADB] 2 device(s) connected
[ADB] Running 'D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe' with args: ["-P",5037,"-s","127.0.0.1:62025","shell","am","force-stop","io.appium.unlock"]
[AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.


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