文章出处http://blog.csdn.net/yan1234abcd/article/details/60765295

每次运行测试,可以从Appium Server控制台看到有特别多的日志输出,这些日志其实很清楚的显示一个test从启动到case完成的活动过程

所以如果能够更好的理解这些日志的内容,会帮助我们更好的理解整个测试流程。

下面是一个例子,主要功能是在安卓模拟器上安装某个APP,并进行登录。

日志的具体内容如下所示:

> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.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:\project\AppiumFirstTest\app\Winky_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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 wait-for-device
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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\node_modules\appium\node_modules\appium-adb\jars\appium_apk_tools.jar" "stringsFromApk"  "D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk" "C:\Users\win7\AppData\Local\Temp\com.weiboyi.winky" zh
> info: [debug] Reading strings from converted strings.json
> info: [debug] Setting language to default
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\build-tools\23.0.2\aapt.exe
> info: [debug] Retrieving process from manifest.
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\build-tools\23.0.2\aapt.exe" dump xmltree  D:\project\AppiumFirstTest\app\Winky_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:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk.
> info: [debug] executing cmd: java -jar "C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\jars\verify.jar"  D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk
> info: [debug] App already signed.
> info: [debug] Zip-aligning D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk
> info: [debug] Checking whether zipalign is present
> info: [debug] Using zipalign from D:\Program Files\Android\android-sdk\build-tools\23.0.2\zipalign.exe
> info: [debug] Zip-aligning apk.
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\build-tools\23.0.2\zipalign.exe" -f 4 D:\project\AppiumFirstTest\app\Winky_default_1.2.16.apk C:\Users\win7\AppData\Local\Temp\115113-3716-wbhh3m\appium.tmp
> info: [debug] MD5 for app is 37dbd1e6b45b84b54581706c71725f6c
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 shell "mkdir -p /data/local/tmp/"
> info: [debug] Removing any old apks
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 shell "ls /data/local/tmp/*.apk"
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 shell rm "/data/local/tmp/4634d715dc9bf150d018dc51ade40e88.apk"
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 shell "am force-stop com.weiboyi.winky"
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 uninstall com.weiboyi.winky
> info: [debug] App was uninstalled
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 forward tcp:4724
===== 通过adb执行相应的shell命令,建立Appium Server到目标机器上的端口转发

> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.exe" -s emulator-5554 shell "dumpsys window windows"
> info: [debug] executing cmd: "D:\Program Files\Android\android-sdk\platform-tools\adb.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 Files\Android\android-sdk\platform-tools\adb.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"}

appium server日志分析的更多相关文章

  1. Appium Server源码分析之作为Bootstrap客户端

    Appium Server拥有两个主要的功能: 它是个http服务器,它专门接收从客户端通过基于http的REST协议发送过来的命令 他是bootstrap客户端:它接收到客户端的命令后,需要想办法把 ...

  2. Appium Server 源码分析之启动运行Express http服务器

    通过上一个系列Appium Android Bootstrap源码分析我们了解到了appium在安卓目标机器上是如何通过bootstrap这个服务来接收appium从pc端发送过来的命令,并最终使用u ...

  3. 启动appium server时打印日志时间

    在调试脚本的时候想看查找元素和执行命令花了多少时间,我们可以在启动appium server的时候加上启动参数,实现我们的需求. 1)输入:appium h,可以查看appium提供的启动参数有哪些. ...

  4. 手机自动化测试:Appium源码分析之跟踪代码分析八

    手机自动化测试:Appium源码分析之跟踪代码分析八   poptest是国内唯一一家培养测试开发工程师的培训机构,以学员能胜任自动化测试,性能测试,测试工具开发等工作为目标.如果对课程感兴趣,请大家 ...

  5. ELK+Kafka集群日志分析系统

    ELK+Kafka集群分析系统部署 因为是自己本地写好的word文档复制进来的.格式有些出入还望体谅.如有错误请回复.谢谢! 一. 系统介绍 2 二. 版本说明 3 三. 服务部署 3 1) JDK部 ...

  6. MyCAT日志分析

    MyCAT日志对于了解MyCAT的运行信息不可获取,譬如MyCAT是否采用读写分离,对于一个查询语句,MyCAT是怎样执行的,每个分片会分发到哪个节点上等等. 默认是info级别,通过log4j.xm ...

  7. ELK+redis搭建nginx日志分析平台

    ELK+redis搭建nginx日志分析平台发表于 2015-08-19   |   分类于 Linux/Unix   |  ELK简介ELKStack即Elasticsearch + Logstas ...

  8. nginx日志分析利器GoAccess

    面试的时候一定会被面到的问题是:给出web服务器的访问日志,请写一个脚本来统计访问前10的IP有哪些?访问前10的请求有哪些?当你领略过goaccess之后,你就明白,这些问题,除了考验你的脚本背诵记 ...

  9. 【转】ELK(ElasticSearch, Logstash, Kibana)搭建实时日志分析平台

    [转自]https://my.oschina.net/itblog/blog/547250 摘要: 前段时间研究的Log4j+Kafka中,有人建议把Kafka收集到的日志存放于ES(ElasticS ...

随机推荐

  1. CSS径向渐变radial-gradient

    可以做一些效果,不错! 网址:http://www.cnblogs.com/xiaohuochai/p/5383285.html

  2. Linux初学者学习资料

    鸟哥的Linux私房菜 http://vbird.dic.ksu.edu.tw/linux_basic/linux_basic.php

  3. java字符串、时间大小比较

    package mytest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util ...

  4. 52、图片缩放库 PhotoView

    PhotoView的简介: 这是一个图片查看库,实现图片浏览功能,支持pinch(捏合)手势或者点击放大缩小.支持在ViewPager中翻页浏览图片. PhotoView 是一款扩展自Android ...

  5. IOS控件:分歧解决其(UILabel 和 IBAction)

    #import <UIKit/UIKit.h> @interface demo7_dayViewController : UIViewController { // 用来显示程序结果 IB ...

  6. poj 2923(状态压缩+背包)

    比较巧妙的一道题目,拿到题目就想用暴力直接搜索,仔细分析了下发现复杂度达到了2^n*n! ,明显不行,于是只好往背包上想. 于是又想二分找次数判断可行的方法,但是发现复杂度10^8还是很悬... 然后 ...

  7. iOS 修改textholder的颜色

    UITextField *textField = [[UITextField alloc]initWithFrame:CGRectMake(, , , )]; textField.placeholde ...

  8. java如何遍历当月所有的日期?

    转自:https://zhidao.baidu.com/question/360215274.html import java.util.ArrayList;import java.util.Cale ...

  9. LeetCode-Integer Breaks

    Given a positive integer n, break it into the sum of at least two positive integers and maximize the ...

  10. [LintCode] 有效回文串

    class Solution { public: /** * @param s A string * @return Whether the string is a valid palindrome ...