appium 3-31603调试分析方法

【appium 3-31603调试分析方法】与天地兮比寿,与日月兮齐光。这篇文章主要讲述appium 3-31603调试分析方法相关的知识,希望能为你提供帮助。
Appium Log

清晰记录了所有的请求和结果

[Appium] Welcome to Appium v1.8.1 [Appium] Appium REST http interface listener started on 0.0.0.0:4723 #启动appium //启动appium < font color=#FF0000> 启动< /font> [HTTP] --> POST /wd/hub/session [HTTP] {"desiredCapabilities":{"appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","noReset":true,"newCommandTimeout":1200,"automationName":"UiAutomator2","platformName":"Android","deviceName":"domo"},"capabilities":{"alwaysMatch":{"appium:appActivity":".view.WelcomeActivityAlias","appium:appPackage":"com.xueqiu.android","appium:automationName":"UiAutomator2","appium:deviceName":"domo","appium:newCommandTimeout":1200,"appium:noReset":true,"platformName":"android"},"firstMatch":[{}]}} [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","noReset":true,"newCommandTimeout":1200,"automationName":"UiAutomator2","platformName":"Android","deviceName":"domo"},null,{"alwaysMatch":{"appium:appActivity":".view.WelcomeActivityAlias","appium:appPackage":"com.xueqiu.android","appium:automationName":"UiAutomator2","appium:deviceName":"domo","appium:newCommandTimeout":1200,"appium:noReset":true,"platformName":"android"},"firstMatch":[{}]}] [debug] [BaseDriver] Event ‘newSessionRequested‘ logged at 1538809529667 (15:05:29 GMT+0800 (CST)) [Appium] Creating new AndroidUiautomator2Driver (v1.12.0) session [Appium] Capabilities: [Appium]platformName: android [Appium]appActivity: .view.WelcomeActivityAlias [Appium]appPackage: com.xueqiu.android [Appium]automationName: UiAutomator2 [Appium]deviceName: domo [Appium]newCommandTimeout: 1200 [Appium]noReset: true [debug] [BaseDriver] W3C capabilities {"alwaysMatch":{"platformNa... and MJSONWP desired capabilities [object Object] were provided [debug] [BaseDriver] Creating session with W3C capabilities: {"alwaysMatch":{"platformNa... [BaseDriver] Session created with session id: 0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 [debug] [AndroidDriver] Getting java version [AndroidDriver] Java version is: 1.8.0_131 [ADB] Checking whether adb is present [ADB] Found 2 ‘build-tools‘ folders under ‘/Users/chenshanju/Library/Android/sdk‘ (newest first): [ADB]/Users/chenshanju/Library/Android/sdk/build-tools/28.0.2 [ADB]/Users/chenshanju/Library/Android/sdk/build-tools/26.0.0 [ADB] Using adb from /Users/chenshanju/Library/Android/sdk/platform-tools/adb [AndroidDriver] Retrieving device list [debug] [ADB] Trying to find a connected android device [debug] [ADB] Getting connected devices... [debug] [ADB] 1 device(s) connected [AndroidDriver] Using device: 406e8f3 [debug] [ADB] Setting device id to 406e8f3 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell getprop ro.build.version.sdk‘ [debug] [ADB] Current device property ‘ro.build.version.sdk‘: 27 [debug] [ADB] Device API level: 27 [AndroidDriver] No app sent in, not parsing package/activity [ADB] Getting device platform version [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell getprop ro.build.version.release‘ [debug] [ADB] Current device property ‘ro.build.version.release‘: 8.1.0 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell wm size‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell wm density‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell getprop ro.product.model‘ [debug] [ADB] Current device property ‘ro.product.model‘: Redmi Note 5 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell getprop ro.product.manufacturer‘ [debug] [ADB] Current device property ‘ro.product.manufacturer‘: Xiaomi [debug] [ADB] Device API level: 27 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell am force-stop io.appium.uiautomator2.server‘ [debug] [ADB] Checking app cert for /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.12.0.apk [ADB] Using apksigner from /Users/chenshanju/Library/Android/sdk/build-tools/28.0.2/apksigner [debug] [ADB] Starting ‘/Users/chenshanju/Library/Android/sdk/build-tools/28.0.2/apksigner‘ with args ‘verify,--print-certs,/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.12.0.apk‘ [debug] [ADB] ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.12.0.apk‘ is already signed. [debug] [ADB] Checking app cert for /usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk [debug] [ADB] Starting ‘/Users/chenshanju/Library/Android/sdk/build-tools/28.0.2/apksigner‘ with args ‘verify,--print-certs,/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk‘ [debug] [ADB] ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk‘ is already signed. [debug] [ADB] Getting install status for io.appium.uiautomator2.server [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell pm list packages io.appium.uiautomator2.server‘ [debug] [ADB] App is installed [debug] [ADB] Getting package info for ‘io.appium.uiautomator2.server‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell dumpsys package io.appium.uiautomator2.server‘ [ADB] Checking whether aapt is present [ADB] Using aapt from /Users/chenshanju/Library/Android/sdk/build-tools/28.0.2/aapt [debug] [ADB] The installed ‘io.appium.uiautomator2.server‘ package does not require upgrade (‘1.12.0‘ > = ‘1.12.0‘) [debug] [ADB] Getting install status for io.appium.uiautomator2.server.test [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell pm list packages io.appium.uiautomator2.server.test‘ [debug] [ADB] App is installed [debug] [ADB] Getting package info for ‘io.appium.uiautomator2.server.test‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell dumpsys package io.appium.uiautomator2.server.test‘ [ADB] Cannot read version codes of ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk‘ and/or ‘io.appium.uiautomator2.server.test‘ [ADB] Cannot read version names of ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk‘ and/or ‘io.appium.uiautomator2.server.test‘. Assuming correct app version is already installed [debug] [UiAutomator2] Waiting up to 20000ms for instrumentation ‘io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner‘ to be available [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell pm list instrumentation‘ [debug] [UiAutomator2] Instrumentation ‘io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner‘ available [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 wait-for-device‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell echo ping‘ [debug] [AndroidDriver] Pushing settings apk to device... [debug] [ADB] Getting install status for io.appium.settings [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell pm list packages io.appium.settings‘ [debug] [ADB] App is installed [debug] [ADB] Getting package info for ‘io.appium.settings‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell dumpsys package io.appium.settings‘ [debug] [ADB] The installed ‘io.appium.settings‘ package does not require upgrade (‘2.3.0‘ > = ‘2.3.0‘) [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell ps‘ [debug] [ADB] Device API level: 27 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell am start -W -n io.appium.settings/.Settings -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000‘ [debug] [ADB] Device API level: 27 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell appops set io.appium.settings android:mock_location allow‘ [AndroidDriver] setDeviceLanguageCountry requires language or country. [AndroidDriver] Got language: ‘null‘ and country: ‘null‘ [debug] [Logcat] Starting logcat capture [debug] [AndroidDriver] Pushing unlock helper app to device... [debug] [ADB] Getting install status for io.appium.unlock [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell pm list packages io.appium.unlock‘ [debug] [ADB] App is installed [debug] [ADB] Getting package info for ‘io.appium.unlock‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell dumpsys package io.appium.unlock‘ [debug] [ADB] The installed ‘io.appium.unlock‘ package does not require upgrade (‘2.0.0‘ > = ‘2.0.0‘) [debug] [UiAutomator2] Forwarding UiAutomator2 Server port 6790 to 8200 [debug] [ADB] Forwarding system: 8200 to device: 6790 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 forward tcp:8200 tcp:6790‘ [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell rm -rf /data/local/tmp/strings.json‘ [debug] [UiAutomator2] No app capability. Assuming it is already on the device [debug] [ADB] Checking app cert for null [debug] [ADB] ‘null‘ doesn‘t exist [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell am force-stop io.appium.uiautomator2.server‘ [UiAutomator2] Starting uiautomator2 server 1.12.0 [UiAutomator2] Using UIAutomator2 server from ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-v1.12.0.apk‘ and test from ‘/usr/local/lib/node_modules/appium/node_modules/appium-uiautomator2-server/apks/appium-uiautomator2-server-debug-androidTest.apk‘ [UiAutomator2] Running command: ‘adb -s 406e8f3 shell am instrument -w io.appium.uiautomator2.server.test/android.support.test.runner.AndroidJUnitRunner‘ [UiAutomator2] Waiting up to 20000ms for UiAutomator2 to be online... [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [debug] [JSONWP Proxy] Proxying [GET /status] to [GET http://localhost:8200/wd/hub/status] with no body [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"SESSIONID","status":0,"value":"Status Invoked"}" [debug] [JSONWP Proxy] Proxying [POST /session] to [POST http://localhost:8200/wd/hub/session] with body: {"desiredCapabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"domo","newCommandTimeout":1200,"noReset":true},"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"406e8f3","newCommandTimeout":1200,"noReset":true,"deviceUDID":"406e8f3","platformVersion":"8.1.0","deviceScreenSize":"1080x2160","deviceScreenDensity":440,"deviceModel":"Redmi Note 5","deviceManufacturer":"Xiaomi","deviceApiLevel":27}} [debug] [JSONWP Proxy] Got response with status 200: {"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":"Created Session"} [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell dumpsys window‘ [AndroidDriver] Screen already unlocked, doing nothing [UiAutomator2] UiAutomator2 did not start the activity we were waiting for, ‘com.xueqiu.android/.view.WelcomeActivityAlias‘. Starting it ourselves [debug] [ADB] Device API level: 27 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell am start -W -n com.xueqiu.android/.view.WelcomeActivityAlias -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000‘ [debug] [JSONWP Proxy] Proxying [GET /appium/device/pixel_ratio] to [GET http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991/appium/device/pixel_ratio] with body: {} [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":2.75}" [debug] [JSONWP Proxy] Proxying [GET /appium/device/system_bars] to [GET http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991/appium/device/system_bars] with body: {} [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":{"statusBar":66}}" [debug] [JSONWP Proxy] Proxying [GET /window/current/size] to [GET http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991/window/current/size] with body: {} [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":{"height":2030,"width":1080}}" [Appium] New AndroidUiautomator2Driver session created successfully, session 0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 added to master session list [debug] [BaseDriver] Event ‘newSessionStarted‘ logged at 1538809542214 (15:05:42 GMT+0800 (CST)) [debug] [W3C] Responding to client with driver.createSession() result: {"capabilities":{"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"domo","newCommandTimeout":1200,"noReset":true},"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"406e8f3","newCommandTimeout":1200,"noReset":true,"deviceUDID":"406e8f3","platformVersion":"8.1.0","deviceScreenSize":"1080x2160","deviceScreenDensity":440,"deviceModel":"Redmi Note 5","deviceManufacturer":"Xiaomi","deviceApiLevel":27,"pixelRatio":2.75,"statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":1964}}} [HTTP] < -- POST /wd/hub/session 200 12555 ms - 960 [HTTP] [HTTP] --> GET /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 [HTTP] {} [debug] [W3C] Calling AppiumDriver.getSession() with args: ["0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0"] [debug] [UiAutomator2] Getting session details from server to mix in [debug] [JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991] with body: {} [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":{}}" [debug] [W3C] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"domo","newCommandTimeout":1200,"noReset":true},"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"406e8f3","newCommandTimeout":1200,"noReset":true,"deviceUDID":"406e8f3","platformVersion":"8.1.0","deviceScreenSize":"1080x2160","deviceScreenDensity":440,"deviceModel":"Redmi Note 5","deviceManufacturer":"Xiaomi","deviceApiLevel":27,"pixelRatio":2.75,"statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":1964}} [HTTP] < -- GET /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 200 35 ms - 892 [HTTP] [HTTP] --> GET /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 [HTTP] {} [debug] [W3C] Calling AppiumDriver.getSession() with args: ["0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0"] [debug] [UiAutomator2] Getting session details from server to mix in [debug] [JSONWP Proxy] Proxying [GET /] to [GET http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991] with body: {} [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":{}}" [debug] [W3C] Responding to client with driver.getSession() result: {"platform":"LINUX","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"domo","newCommandTimeout":1200,"noReset":true},"platformName":"android","appActivity":".view.WelcomeActivityAlias","appPackage":"com.xueqiu.android","automationName":"UiAutomator2","deviceName":"406e8f3","newCommandTimeout":1200,"noReset":true,"deviceUDID":"406e8f3","platformVersion":"8.1.0","deviceScreenSize":"1080x2160","deviceScreenDensity":440,"deviceModel":"Redmi Note 5","deviceManufacturer":"Xiaomi","deviceApiLevel":27,"pixelRatio":2.75,"statBarHeight":66,"viewportRect":{"left":0,"top":66,"width":1080,"height":1964}} [HTTP] < -- GET /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 200 21 ms - 892 [HTTP] [HTTP] --> POST /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0/timeouts [HTTP] {"implicit":20000} [debug] [W3C] Calling AppiumDriver.timeouts() with args: [{"protocol":"W3C","implicit":20000},"0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0"] [debug] [BaseDriver] script: undefined, pageLoad: undefined, implicit: 20000 [debug] [BaseDriver] Set implicit wait to 20000ms [debug] [W3C] Responding to client with driver.timeouts() result: null [HTTP] < -- POST /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0/timeouts 200 5 ms - 14 [HTTP] [HTTP] --> POST /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0/element [HTTP] {"using":"xpath","value":"//*[@text="允许"]"} [debug] [W3C] Calling AppiumDriver.findElement() with args: ["xpath","//*[@text="允许"]","0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0"] [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator [debug] [BaseDriver] Waiting up to 20000 ms for condition [debug] [JSONWP Proxy] Proxying [POST /element] to [POST http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991/element] with body: {"strategy":"xpath","selector":"//*[@text="允许"]","context":"","multiple":false} [W3C] Encountered internal error running command:{"w3cStatus":400,"jsonwp":{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":7,"value":"An element could not be located on the page using the given search parameters."}} ProxyRequestError: Could not proxy command to remote server. Original error: 500 - {"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":7,"value":"An element could not be located on the page using the given search parameters."} [W3C]at JWProxy.proxy$ (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/jsonwp-proxy/proxy.js:152:13) [W3C]at tryCatch (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40) [W3C]at GeneratorFunctionPrototype.invoke [as _invoke] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22) [W3C]at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21) [W3C]at GeneratorFunctionPrototype.invoke (/usr/local/lib/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37) [W3C]at < anonymous> [debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError [HTTP] < -- POST /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0/element 404 2481 ms - 1224 [HTTP] [HTTP] --> DELETE /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 [HTTP] {} [debug] [W3C] Calling AppiumDriver.deleteSession() with args: ["0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0"] [debug] [BaseDriver] Event ‘quitSessionRequested‘ logged at 1538809549875 (15:05:49 GMT+0800 (CST)) [Appium] Removing session 0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 from our master session list [debug] [UiAutomator2] Deleting UiAutomator2 session [debug] [UiAutomator2] Deleting UiAutomator2 server session [debug] [JSONWP Proxy] Proxying [DELETE /] to [DELETE http://localhost:8200/wd/hub/session/ae8224b2-a988-4479-8368-bd26ff5ca991] with no body [debug] [JSONWP Proxy] Got response with status 200: "{"sessionId":"ae8224b2-a988-4479-8368-bd26ff5ca991","status":0,"value":"Session deleted"}" [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 shell am force-stop com.xueqiu.android‘ [debug] [Logcat] Stopping logcat capture [debug] [ADB] Removing forwarded port socket connection: 8200 [debug] [ADB] Running ‘/Users/chenshanju/Library/Android/sdk/platform-tools/adb -P 5037 -s 406e8f3 forward --remove tcp:8200‘ [debug] [BaseDriver] Event ‘quitSessionFinished‘ logged at 1538809550075 (15:05:50 GMT+0800 (CST)) [debug] [W3C] Received response: null [debug] [W3C] But deleting session, so not returning [debug] [W3C] Responding to client with driver.deleteSession() result: null [HTTP] < -- DELETE /wd/hub/session/0bc0f9ca-b2fc-43d1-91a2-c7525ed848d0 200 202 ms - 14 [HTTP] [debug] [UiAutomator2] [UIAutomator2] io.appium.uiautomator2.server.test.AppiumUiAutomator2Server:. [debug] [UiAutomator2] [UIAutomator2] Time: 11.084 [debug] [UiAutomator2] [UIAutomator2] OK (1 test)

getPageSource
界面的完成dom结构.xml文件

脚本内调试
利用xpath获取所有匹配的元素 driver.findElementByXpath("//*")


    推荐阅读