文章出处http://blog.csdn.net/yan1234abcd/article/details/60765295
每次运行测试,可以从Appium Server控制台看到有特别多的日志输出,这些日志其实很清楚的显示一个test从启动到case完成的活动过程
所以如果能够更好的理解这些日志的内容,会帮助我们更好的理解整个测试流程。
下面是一个例子,主要功能是在安卓模拟器上安装某个APP,并进行登录。
日志的具体内容如下所示:
> Launching Appium server with command: C:Program Files (x86)Appium
ode.exe libservermain.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 23 --automation-name Appium --log-no-color
> warn: Appium support for versions of node < 0.12 has been deprecated and will be removed in a future version. Please upgrade!
> info: Welcome to Appium v1.4.13 (REV c75d8adcb66a75818a542fe1891a34260c21f76a)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"23","automationName":"Appium"}
> info: Console LogLevel: debug
===== 启动REST http服务器,默认监听 本地4723端口(这里可通过ip配置appium server的地址)
用于接收客户端(Test Case+Selenium/Appium Driver)发过来的JSON格式的命令指示。
> info: --> POST /wd/hub/session {"desiredCapabilities":{"automationName":"Appium","platformVersion":"4.2.2","app":"D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk","deviceName":"Android Emulator","platformName":"Android",
"appActivity":".ui.activity.MainActivity","appPackage":"com.weiboyi.winky"}}
> info: Client User-Agent string: Apache-HttpClient/4.3.3 (java 1.5)
> info: [debug] Using local app from desired caps: D:projectAppiumFirstTestappWinky_default_1.2.16.apk
> info: [debug] Creating new appium session 3c687853-cbb9-4ad4-ac30-00fddbec10fe
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.7.0_79
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe
> info: [debug] Using fast reset? true
===== 根据客户端提供的capabilities指示建立一个Android Sesision用于跟客户端保持后续通信
> info: [debug] Preparing device for session
> info: [debug] Checking whether app is actually present
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" devices
> info: [debug] 1 device(s) connected
> info: Found device emulator-5554
> info: [debug] Setting device id to emulator-5554
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 wait-for-device
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "echo 'ready'"
===== 通过”adb devices“命令列出查询到的手机 emulator-5554
=====通过"adb -s emulator-5554 wait-for-device"和"adb -s emulator-5554 shell "echo 'ready'"检查安卓手机是否已经准备好
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
> info: Device API level is: 19
===== 通过adb执行相应的shell命令获得安卓机器的API Level
> info: [debug] Extracting strings for language: default
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "getprop persist.sys.language"
> info: [debug] Current device persist.sys.language: zh
> info: [debug] java -jar "C:Program Files (x86)Appium
ode_modulesappium
ode_modulesappium-adbjarsappium_apk_tools.jar" "stringsFromApk" "D:projectAppiumFirstTestappWinky_default_1.2.16.apk" "C:Userswin7AppDataLocalTempcom.weiboyi.winky" zh
> info: [debug] Reading strings from converted strings.json
> info: [debug] Setting language to default
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 push "C:\Users\win7\AppData\Local\Temp\com.weiboyi.winky\strings.json" /data/local/tmp
> info: [debug] Checking whether aapt is present
> info: [debug] Using aapt from D:Program FilesAndroidandroid-sdkuild-tools23.0.2aapt.exe
> info: [debug] Retrieving process from manifest.
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkuild-tools23.0.2aapt.exe" dump xmltree D:projectAppiumFirstTestappWinky_default_1.2.16.apk AndroidManifest.xml
> info: [debug] Set app process to: com.weiboyi.winky
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Checking app cert for D:projectAppiumFirstTestappWinky_default_1.2.16.apk.
> info: [debug] executing cmd: java -jar "C:Program Files (x86)Appium
ode_modulesappium
ode_modulesappium-adbjarsverify.jar" D:projectAppiumFirstTestappWinky_default_1.2.16.apk
> info: [debug] App already signed.
> info: [debug] Zip-aligning D:projectAppiumFirstTestappWinky_default_1.2.16.apk
> info: [debug] Checking whether zipalign is present
> info: [debug] Using zipalign from D:Program FilesAndroidandroid-sdkuild-tools23.0.2zipalign.exe
> info: [debug] Zip-aligning apk.
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkuild-tools23.0.2zipalign.exe" -f 4 D:projectAppiumFirstTestappWinky_default_1.2.16.apk C:Userswin7AppDataLocalTemp115113-3716-wbhh3mappium.tmp
> info: [debug] MD5 for app is 37dbd1e6b45b84b54581706c71725f6c
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell " ls /data/local/tmp/37dbd1e6b45b84b54581706c71725f6c.apk"
> info: [debug] Getting install status for com.weiboyi.winky
=====使用工具aapt,通过命令“aapt dump badging Winky_default_1.2.16.apk”来获得dobby的packageName和launchable activityName
> info: [debug] Getting device API level
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
===== 通过adb执行相应的shell命令获得安卓机器的API Level
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "pm list packages -3 com.weiboyi.winky"
> info: [debug] App is installed
> info: Installing App
===== 通过adb执行相应的shell命令检查目标应用是否已经存在 pm list packages -3 com.weiboyi.winky
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "mkdir -p /data/local/tmp/"
> info: [debug] Removing any old apks
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "ls /data/local/tmp/*.apk"
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell rm "/data/local/tmp/4634d715dc9bf150d018dc51ade40e88.apk"
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 push "D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk" /data/local/tmp/37dbd1e6b45b84b54581706c71725f6c.apk
> info: [debug] Uninstalling com.weiboyi.winky
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "am force-stop com.weiboyi.winky"
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 uninstall com.weiboyi.winky
> info: [debug] App was uninstalled
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "pm install -r /data/local/tmp/37dbd1e6b45b84b54581706c71725f6c.apk"
===== 通过adb执行相应的shell命令,在安卓目标机器上清理目标应用运行环境:该卸载就卸载,该停止就停止,该清空数据就清空数据
> info: [debug] Forwarding system:4727 to device:4724
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 forward tcp:4724
===== 通过adb执行相应的shell命令,建立Appium Server到目标机器上的端口转发
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/
===== 通过adb执行相应的shell命令,把AppiumBootstrap.apk push到目标设备:这是目标机器上通过uiautomator工具(框架)运行的服务端,用于接受处理client端发送过来的命令
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 install "C:Program Files (x86)Appium
ode_modulesappiumuildsettings_apksettings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 install "C:Program Files (x86)Appium
ode_modulesappiumuildunlock_apkunlock_apk-debug.apk"
> info: Starting App
=====通过adb执行相应的shell命令, 把settings_apk-debug.apk和unlock_apk-debug.apk push到目标机器:emulator-5554
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "ps 'uiautomator'"
===== 通过adb执行相应的shell命令确保uiautomator没有已经在跑
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe -s emulator-5554 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.weiboyi.winky -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class="io".appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> info: [debug] [BOOTSTRAP] [debug] json loading complete.
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: wake
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "dumpsys window"
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] dataDir set to: /data
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"/data","status":0}
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":false,"status":0}
> info: [debug] Getting device API level
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
===== 通过adb把目标机器上的Appium BootStrap跑起来:”uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Rootstrap”.
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.weiboyi.winky/.ui.activity.MainActivity"
> info: [debug] Waiting for pkg "com.weiboyi.winky" and activity ".ui.activity.MainActivity" to be focused
> info: [debug] Getting focused package and activity
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "dumpsys window windows"
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "getprop ro.build.version.release"
> info: [debug] Device is at release version 4.4.4
> info: [debug] Device launched! Ready for commands
> info: [debug] Setting command timeout to the default of 60 secs
===== 通过adb在目标机器上 Launch app
> info: [debug] Appium session started with sessionId 3c687853-cbb9-4ad4-ac30-00fddbec10fe
> info: <-- POST /wd/hub/session 303 75048.909 ms - 74
> info: --> GET /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe {}
> info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.4.4",
"webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,
"locationContextEnabled":false,"warnings":{},"desired":{"automationName":"Appium","platformVersion":"4.2.2",
"app":"D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk","deviceName":"Android Emulator","platformName":"Android",
"appActivity":".ui.activity.MainActivity","appPackage":"com.weiboyi.winky"},"automationName":"Appium",
"app":"D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk","deviceName":"emulator-5554","platformName":"Android",
"appActivity":".ui.activity.MainActivity","appPackage":"com.weiboyi.winky"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- GET /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe 200 2.212 ms - 804 {"status":0,"value":{"platform":"LINUX","browserName":"Android",
"platformVersion":"4.4.4","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,
"locationContextEnabled":false,"warnings":{},"desired":{"automationName":"Appium","platformVersion":"4.2.2",
"app":"D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk","deviceName":"Android Emulator","platformName":"Android","appActivity":
".ui.activity.MainActivity","appPackage":"com.weiboyi.winky"},"automationName":"Appium","app":"D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk",
"deviceName":"emulator-5554","platformName":"Android","appActivity":".ui.activity.MainActivity","appPackage":"com.weiboyi.winky"},
"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 通知PC端目标应用已经在目标机器启动成功
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element {"using":"id","value":"username"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"username","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"username","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 username using ID with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.weiboyi.winky:id/username]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"1"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element 200 3347.068 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 定位”用户名“输入框:Bootstrap通过的UIAutomator的UISelector类根据resource-id获得输入框的ID并返回给客户端
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/1/clear {"id":"1"}
> info: [debug] Pushing command to appium work queue: ["element:clear",{"elementId:1"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:clear","parameter",{"elementId:1"}}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: clear
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Text remains after clearing, but it appears to be hint text.
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/1/clear 200 3864.563 ms - 76 {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== BootStrap执行”清空 用户名输入框”命令
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element {"using":"id","value":"username"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"username","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"username","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 username using ID with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.weiboyi.winky:id/username]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"2"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"2"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element 200 635.168 ms - 87 {"status":0,"value":{"ELEMENT":"2"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 定位”用户名“输入框:Bootstrap通过的UIAutomator的UISelector类根据resource-id获得输入框的ID并返回给客户端
===== 可以发现“用户名输入框”在上次已经找过一次了,所以这里我们相当于是在同一个测试方法中对同一个控件查找两次。其实这是有点浪费
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/2/value {"id":"2","value":["cceshi"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elemetnId":"2","text":"cceshi","replace":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"2","text":"cceshi","replace":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: setText
> info: [debug] [BOOTSTRAP] [debug] Using element passed in.
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Text remains after clearing, but it appears to be hint text.
> info: [debug] [BOOTSTRAP] [debug] Text not cleared. Assuming remainder is hint text.
> info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: cceshi
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/2/value 200 7632.310 ms - 76 {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== BootStrap执行”向 用户名输入框 填写cceshi”命令
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element {"using":"id","value":"password"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"password","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"password","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 password using ID with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.weiboyi.winky:id/password]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"3"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"3"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element 200 487.965 ms - 87 {"status":0,"value":{"ELEMENT":"3"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 定位”密码“输入框:Bootstrap通过的UIAutomator的UISelector类根据resource-id获得输入框的ID并返回给客户端
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/3/clear {"id":"3"}
> info: [debug] Pushing command to appium work queue: ["element:clear",{"elementId":"3"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:clear","params":{"elementId":"3"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: clear
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/3/clear 200 3801.019 ms - 76 {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== BootStrap执行”清空 密码 输入框”命令
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element {"using":"id","value":"password"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"password","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"password","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 password using ID with the contextId: multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.weiboyi.winky:id/password]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"4"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"4"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element 200 290.380 ms - 87 {"status":0,"value":{"ELEMENT":"4"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 定位”密码“输入框:Bootstrap通过的UIAutomator的UISelector类根据resource-id获得输入框的ID并返回给客户端
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/4/value {"id":"4","value":["weibo2013yic"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"4","text":"weibo2013yic","replace":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"4","text":"weibo2013yic","replace":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: setText
> info: [debug] [BOOTSTRAP] [debug] Using element passed in.
> info: [debug] [BOOTSTRAP] [debug] Attempting to clear using UiObject.clearText().
> info: [debug] [BOOTSTRAP] [debug] Sending plain text to element: weibo2013yic
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/4/value 200 7854.103 ms - 76 {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== BootStrap执行”向 用户名输入框 填写weibo2013yic”命令
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element {"using":"id","value":"user_sign_in_button"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"user_sign_in_button","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"user_sign_in_button","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 user_sign_in_button using ID with the contextId: multiple: false
> info: [debug] [UIAUTOMATOR STDOUT] [APPIUM-UIAUTO] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.weiboyi
> info: [debug] [UIAUTOMATOR STDOUT].winky:id/user_sign_in_button][/APPIUM-UIAUTO]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"5"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"5"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element 200 660.639 ms - 87 {"status":0,"value":{"ELEMENT":"5"},"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
===== 定位”登录“按钮:Bootstrap通过的UIAutomator的UISelector类根据resource-id获得输入框的ID并返回给客户端
> info: --> POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/5/click {"id":"5"}
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"5"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"5"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: click
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- POST /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe/element/5/click 200 962.940 ms - 76 {"status":0,"value":true,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: --> DELETE /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe {}
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
> info: [debug] executing cmd: "D:Program FilesAndroidandroid-sdkplatform-toolsadb.exe" -s emulator-5554 shell "input keyevent 3"
===== BootStrap执行”点击登录按钮”命令
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"OK, shutting down","status":0}
===== 关闭logcat
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class="io".appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 54.578
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator shut down normally
===== 关闭Uiautomator进程
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}
> info: <-- DELETE /wd/hub/session/3c687853-cbb9-4ad4-ac30-00fddbec10fe 200 6850.914 ms - 76 {"status":0,"value":null,"sessionId":"3c687853-cbb9-4ad4-ac30-00fddbec10fe"}