测试环境:mac 10.12
appium:v1.5.3
测试机:真机 三星 SM-A7000(Android 5.0.2)
用 xpath 定位控件时出现异常:Command returned error:java.lang.RuntimeException: Failed to Dump Window Hierarchy
具体日志如下:
[HTTP] --> POST /wd/hub/session/06d31ce3-fb2c-4a84-9af1-c5b705e31348/element {"using":"xpath","value":"//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.view.View[1]/android.support.v7.widget.RecyclerView[1]/android.widget.LinearLayout[1]"}
[MJSONWP] Calling AppiumDriver.findElement() with args: ["xpath","//android.widget....
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.view.View[1]/android.support.v7.widget.RecyclerView[1]/android.widget.LinearLayout[1]","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.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.RelativeLayout[1]/android.widget.LinearLayout[1]/android.widget.FrameLayout[1]/android.widget.LinearLayout[1]/android.view.View[1]/android.support.v7.widget.RecyclerView[1]/android.widget.LinearLayout[1]' using 'XPATH' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Command returned error:java.lang.RuntimeException: Failed to Dump Window Hierarchy
[HTTP] <-- POST /wd/hub/session/06d31ce3-fb2c-4a84-9af1-c5b705e31348/element 500 79 ms - 154
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":13,"value":"Failed to Dump Window Hierarchy"}