测试人社区

appium 定位和点击时响应特别慢,不知道哪里出了问题。

[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element
[HTTP] {"using":"xpath","value":"//*[@text='输入生产卡号']"}
[W3C (efc61c96)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='输入生产卡号']","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element] with body: {"strategy":"xpath","selector":"//*[@text='输入生产卡号']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":{"ELEMENT":"54d24f89-23ac-403f-b397-b27c3af1aa30","element-6066-11e4-a52e-4f735466cecf":"54d24f89-23ac-403f-b397-b27c3af1aa30"}}
[W3C (efc61c96)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"54d24f89-23ac-403f-b397-b27c3af1aa30","ELEMENT":"54d24f89-23ac-403f-b397-b27c3af1aa30"}
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element 200 10208 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":10000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":10000}}
[BaseDriver] Set implicit wait to 10000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/54d24f89-23ac-403f-b397-b27c3af1aa30/click
[HTTP] {"id":"54d24f89-23ac-403f-b397-b27c3af1aa30"}
[W3C (efc61c96)] Calling AppiumDriver.click() with args: ["54d24f89-23ac-403f-b397-b27c3af1aa30","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[WD Proxy] Matched '/element/54d24f89-23ac-403f-b397-b27c3af1aa30/click' to command name 'click'
[WD Proxy] Proxying [POST /element/54d24f89-23ac-403f-b397-b27c3af1aa30/click] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element/54d24f89-23ac-403f-b397-b27c3af1aa30/click] with body: {"element":"54d24f89-23ac-403f-b397-b27c3af1aa30"}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[W3C (efc61c96)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/54d24f89-23ac-403f-b397-b27c3af1aa30/click 200 30241 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element
[HTTP] {"using":"xpath","value":"//*[@text='1']"}
[W3C (efc61c96)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='1']","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element] with body: {"strategy":"xpath","selector":"//*[@text='1']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":{"ELEMENT":"5403ce72-01d5-417f-93ea-a5a980598571","element-6066-11e4-a52e-4f735466cecf":"5403ce72-01d5-417f-93ea-a5a980598571"}}
[W3C (efc61c96)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"5403ce72-01d5-417f-93ea-a5a980598571","ELEMENT":"5403ce72-01d5-417f-93ea-a5a980598571"}
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element 200 10383 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":10000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":10000}}
[BaseDriver] Set implicit wait to 10000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/5403ce72-01d5-417f-93ea-a5a980598571/click
[HTTP] {"id":"5403ce72-01d5-417f-93ea-a5a980598571"}
[W3C (efc61c96)] Calling AppiumDriver.click() with args: ["5403ce72-01d5-417f-93ea-a5a980598571","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[WD Proxy] Matched '/element/5403ce72-01d5-417f-93ea-a5a980598571/click' to command name 'click'
[WD Proxy] Proxying [POST /element/5403ce72-01d5-417f-93ea-a5a980598571/click] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element/5403ce72-01d5-417f-93ea-a5a980598571/click] with body: {"element":"5403ce72-01d5-417f-93ea-a5a980598571"}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[W3C (efc61c96)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/5403ce72-01d5-417f-93ea-a5a980598571/click 200 30298 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element
[HTTP] {"using":"xpath","value":"//*[@text='2']"}
[W3C (efc61c96)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='2']","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element] with body: {"strategy":"xpath","selector":"//*[@text='2']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":{"ELEMENT":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15","element-6066-11e4-a52e-4f735466cecf":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15"}}
[W3C (efc61c96)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15","ELEMENT":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15"}
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element 200 10354 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":10000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":10000}}
[BaseDriver] Set implicit wait to 10000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/8d4716fa-49c2-4d81-9eb5-ce04c47a9e15/click
[HTTP] {"id":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15"}
[W3C (efc61c96)] Calling AppiumDriver.click() with args: ["8d4716fa-49c2-4d81-9eb5-ce04c47a9e15","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[WD Proxy] Matched '/element/8d4716fa-49c2-4d81-9eb5-ce04c47a9e15/click' to command name 'click'
[WD Proxy] Proxying [POST /element/8d4716fa-49c2-4d81-9eb5-ce04c47a9e15/click] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element/8d4716fa-49c2-4d81-9eb5-ce04c47a9e15/click] with body: {"element":"8d4716fa-49c2-4d81-9eb5-ce04c47a9e15"}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[W3C (efc61c96)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/8d4716fa-49c2-4d81-9eb5-ce04c47a9e15/click 200 30138 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element
[HTTP] {"using":"xpath","value":"//*[@text='3']"}
[W3C (efc61c96)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='3']","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element] with body: {"strategy":"xpath","selector":"//*[@text='3']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":{"ELEMENT":"f84e8589-204a-4d35-90ec-d874105b708e","element-6066-11e4-a52e-4f735466cecf":"f84e8589-204a-4d35-90ec-d874105b708e"}}
[W3C (efc61c96)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"f84e8589-204a-4d35-90ec-d874105b708e","ELEMENT":"f84e8589-204a-4d35-90ec-d874105b708e"}
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element 200 10343 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":10000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":10000}}
[BaseDriver] Set implicit wait to 10000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/f84e8589-204a-4d35-90ec-d874105b708e/click
[HTTP] {"id":"f84e8589-204a-4d35-90ec-d874105b708e"}
[W3C (efc61c96)] Calling AppiumDriver.click() with args: ["f84e8589-204a-4d35-90ec-d874105b708e","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[WD Proxy] Matched '/element/f84e8589-204a-4d35-90ec-d874105b708e/click' to command name 'click'
[WD Proxy] Proxying [POST /element/f84e8589-204a-4d35-90ec-d874105b708e/click] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element/f84e8589-204a-4d35-90ec-d874105b708e/click] with body: {"element":"f84e8589-204a-4d35-90ec-d874105b708e"}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[W3C (efc61c96)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/f84e8589-204a-4d35-90ec-d874105b708e/click 200 30161 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element
[HTTP] {"using":"xpath","value":"//*[@text='4']"}
[W3C (efc61c96)] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text='4']","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 10000 ms for condition
[WD Proxy] Matched '/element' to command name 'findElement'
[WD Proxy] Proxying [POST /element] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element] with body: {"strategy":"xpath","selector":"//*[@text='4']","context":"","multiple":false}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":{"ELEMENT":"bb31b99e-d566-441f-8e75-796e948a0938","element-6066-11e4-a52e-4f735466cecf":"bb31b99e-d566-441f-8e75-796e948a0938"}}
[W3C (efc61c96)] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"bb31b99e-d566-441f-8e75-796e948a0938","ELEMENT":"bb31b99e-d566-441f-8e75-796e948a0938"}
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element 200 10364 ms - 137
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":10000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,10000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":10000}}
[BaseDriver] Set implicit wait to 10000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/bb31b99e-d566-441f-8e75-796e948a0938/click
[HTTP] {"id":"bb31b99e-d566-441f-8e75-796e948a0938"}
[W3C (efc61c96)] Calling AppiumDriver.click() with args: ["bb31b99e-d566-441f-8e75-796e948a0938","efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[WD Proxy] Matched '/element/bb31b99e-d566-441f-8e75-796e948a0938/click' to command name 'click'
[WD Proxy] Proxying [POST /element/bb31b99e-d566-441f-8e75-796e948a0938/click] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/element/bb31b99e-d566-441f-8e75-796e948a0938/click] with body: {"element":"bb31b99e-d566-441f-8e75-796e948a0938"}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[W3C (efc61c96)] Responding to client with driver.click() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/element/bb31b99e-d566-441f-8e75-796e948a0938/click 200 30135 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/back
[HTTP] {}
[W3C (efc61c96)] Driver proxy active, passing request on via HTTP proxy
[WD Proxy] Matched '/wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/back' to command name 'back'
[WD Proxy] Proxying [POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/back] to [POST http://127.0.0.1:8201/wd/hub/session/90fa5608-a5f0-46d1-a389-534f51ce70e6/back] with body: {}
[WD Proxy] Got response with status 200: {"sessionId":"90fa5608-a5f0-46d1-a389-534f51ce70e6","value":null}
[WD Proxy] Replacing sessionId 90fa5608-a5f0-46d1-a389-534f51ce70e6 with efc61c96-903f-41c4-975b-cf1335dfa0e8
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/back 200 10201 ms - 65
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts
[HTTP] {"implicit":3000}
[W3C (efc61c96)] Calling AppiumDriver.timeouts() with args: [null,null,null,null,3000,"efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[BaseDriver] W3C timeout argument: {"implicit":3000}}
[BaseDriver] Set implicit wait to 3000ms
[W3C (efc61c96)] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/timeouts 200 1 ms - 14
[HTTP] 
[HTTP] --> POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/appium/app/close
[HTTP] {}
[W3C (efc61c96)] Calling AppiumDriver.closeApp() with args: ["efc61c96-903f-41c4-975b-cf1335dfa0e8"]
[ADB] Running '/Library/Java/android-sdk-macosx/platform-tools/adb -P 5037 -s emulator-5554 shell am force-stop com.app_qa'
[W3C (efc61c96)] Responding to client with driver.closeApp() result: null
[HTTP] <-- POST /wd/hub/session/efc61c96-903f-41c4-975b-cf1335dfa0e8/appium/app/close 200 78 ms - 14

定位用的xpath,如果慢一般就是界面太复杂。appium新出了一个简单的css定位,用来转换为uiautomator的定位,应该会更快些。