Appium自動化測試學習(一)


參考鏈接:http://www.cnblogs.com/tangdongchu/p/4432808.html

環境搭建步驟:
1、安裝appium
通過dmg安裝:國內下載 http://pan.baidu.com/s/1jGvAISu 
2、下載android SDK
下載地址: http://pan.baidu.com/s/1hqGHhRI  ADT分多個版本,其中adt-bundle自帶eclipse和 sdk,推薦下載。這里我們只需要用到SDK。
3、配置環境變量
打開終端,依次輸入命令
touch .bash_profile
open -e .bash_profile
自動打開文本,在文本中添加然后保存
其中ANDROID_HOME為下載的sdk存放的路徑
然后在終端中輸入命令
source .bash_profile
環境變量設置完成,在終端窗口輸入adb回車,不顯示command not found即為成功。
4、選擇合適的python IDE
推薦Eclipse with PyDev、Wing ide和Sublime text
PyDev下載地址: http://pydev.org/
Wing ide下載地址: http://wingware.com/
Sublime text下載地址: http://www.sublimetext.com/
sublimetext2的python開發設置見鏈接:http://www.cnblogs.com/LemonTing/p/4523825.html
5、安裝selenium或Appium-python-client
安裝前需要先安排pip,在終端窗口輸入命令:
sudo easy_install pip
然后安裝appium-python-client,在終端窗口輸入命令:
sudo pip install Appium-Python-Client
當然你也可以安裝selenium,區別只是appium-python-client自帶的方法比selenium的方法要多幾個。
sudo pip install selenium -i http:// pypi.douban.com/simple
此時在終端中輸入python,然后輸入import appium(或import selenium),如果不報錯說明安裝成功
6、編寫appium自動化腳本
參考代碼如下,appium本身是基於selenium的,因此需要用到selenium的包,unittest是用來管理case的,寫case前我們需要先配置一下appium的環境,比如平台、系統版本、設備ID、安裝包、啟動activity、autoLaunch(是否自動安裝apk並啟動)等等。
設備ID獲取:手機連接電腦,打開終端輸入adb devices即可獲得設備ID,插入android機時注意手機調試權限是否打開。
appPackge獲取:連接電腦,啟動應用,打開終端輸入 adb shell ps可以看到應用的PackgeName appActivity獲取:打開終端輸入 aapt d badging Documents/python/apk/Nova_7.2.0_debug.apk 即可查看到launchActivity,其中的apk地址替換為你mac本地的apk地址
注意:aapt命令在sdks的build-tools中,因此前面配置環境變量的時候需要在路徑中加入這個文件夾。
#coding=UTF-8
#! /usr/local/python
'''
Create on 2015-4-16
python 2.7 for mac
@author: tangdongchu
'''
import os
import unittest
from selenium import webdriver
import time

#Appium環境配置
PATH = lambda p: os.path.abspath(
    os.path.join(os.path.dirname(__file__), p)
)

class DpAppTests(unittest.TestCase):
    def setUp(self):
        desired_caps = {}
        desired_caps['platformName'] = 'Android' #設置平台
        desired_caps['platformVersion'] = '4.2' #系統版本
        desired_caps['deviceName'] = '351BBJNGTRWY' #設備id
        desired_caps['autoLaunch'] = 'true' #是否自動啟動
        desired_caps['app'] = PATH(
            'Nova_7.5.0_debug.apk' #安裝包路徑,放在該py文件的目錄下
        )
        desired_caps['appPackage'] = 'com.dianping.v1' #包名
        desired_caps['appActivity'] = 'com.dianping.main.guide.SplashScreenActivity' #啟動的activity

        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

    def tearDown(self):
        self.driver.quit() #case執行完退出

    def test_dpApp(self): #需要執行的case
        time.sleep(15)
        el = self.driver.find_element_by_xpath("//android.widget.TextView[contains(@text,'上海')]") #通過xpath找到定位框
        el.click() #點擊定位框



if __name__ == '__main__':
    suite = unittest.TestLoader().loadTestsFromTestCase(DpAppTests)
    unittest.TextTestRunner(verbosity=2).run(suite) #執行case集

 

 

7、獲取UI元素
將安卓機與mac相連,sdk(/home/software/adb.../sdk)目錄下有個tools文件夾,其中有個uiautomator view程序,打開如下圖,插入設備,點擊下方左側第二個按鈕
得到的界面如下,選中元素即可看到元素的layout信息,比如下方的定位框即可以通過ID來定位,也可以通過Xpath來定位。
8、運行case,打開appium,如圖
選擇Android(如需在IOS上運行,本機還需安裝Xcode),選擇安卓系統的版本,然后launch
回到python ide,運行代碼
此時查看appium窗口,會有日志輸出:
Launching Appium with command: '/Applications/Appium.app/Contents/Resources/node/bin/node' lib/server/main.js --command-timeout "7200" --automation-name "Appium" --platform-name "Android" --platform-version "4.2" --app "/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk"

info: Welcome to Appium v1.3.7 (REV 72fbfaa116d3d9f6a862600ee99cf02f6d0e2182)

info: Appium REST http interface listener started on 0.0.0.0:4723
info: [debug] Non-default server args: {"app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","platformName":"Android","platformVersion":"4.2","automationName":"Appium","defaultCommandTimeout":7200}
info: Console LogLevel: debug

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

info: <-- GET /wd/hub/status 200 8.248 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

info: <-- GET /wd/hub/status 200 3.444 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"351BBJNGTRWY","app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","autoLaunch":"true","platformVersion":"4.2","appPackage":"com.dianping.v1","platformName":"Android","appActivity":"com.dianping.main.guide.SplashScreenActivity"}}

info: Client User-Agent string: Python-urllib/2.7
warn: Converting cap autoLaunch from string to boolean. This might cause unexpected behavior.

info: [debug] Using local app from desired caps: /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk
info: [debug] Creating new appium session b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5
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 /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb
info: [debug] Using fast reset? true
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: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb devices

info: [debug] 1 device(s) connected
info: Found device 351BBJNGTRWY
info: [debug] Setting device id to 351BBJNGTRWY
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY wait-for-device

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "echo 'ready'"

info: [debug] Starting logcat capture

info: [debug] Getting device API level

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 17

info: Device API level is: 17
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "getprop persist.sys.language"

info: [debug] Current device persist.sys.language: zh

info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk" "/tmp/com.dianping.v1" zh

info: [debug] No strings.xml for language 'zh', getting default strings.xml

info: [debug] java -jar "/Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/appium_apk_tools.jar" "stringsFromApk" "/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk" "/tmp/com.dianping.v1"

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY push "/tmp/com.dianping.v1/strings.json" /data/local/tmp

info: [debug] Checking whether aapt is present

info: [debug] Using aapt from /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W/aapt
info: [debug] Retrieving process from manifest.
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W/aapt dump xmltree /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk AndroidManifest.xml

info: [debug] Set app process to: com.dianping.v1

info: [debug] Not uninstalling app since server not started with --full-reset
info: [debug] Checking app cert for /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk.
info: [debug] executing cmd: java -jar /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-adb/jars/verify.jar /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk

info: [debug] App already signed.

info: [debug] Zip-aligning /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk
info: [debug] Checking whether zipalign is present
info: [debug] Using zipalign from /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W/zipalign

info: [debug] Zip-aligning apk.
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/build-tools/android-4.4W/zipalign -f 4 /Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk /var/folders/5d/9kzqrtqd7tb6j4gnz2db02n00000gn/T/115426-3371-1qlz7f0/appium.tmp

info: [debug] MD5 for app is 499bbd53c2f9c045acb7587122ec535b

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "ls /data/local/tmp/499bbd53c2f9c045acb7587122ec535b.apk"

info: [debug] Getting install status for com.dianping.v1

info: [debug] Getting device API level
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 17

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "pm list packages -3 com.dianping.v1"

info: [debug] App is installed

info: App is already installed, resetting app
info: [debug] Running fast reset (stop and clear)
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "am force-stop com.dianping.v1"

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "pm clear com.dianping.v1"

info: [debug] Forwarding system:4724 to device:4724

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY forward tcp:4724 tcp:4724

info: [debug] Pushing appium bootstrap to device...

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY push "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/android_bootstrap/AppiumBootstrap.jar" /data/local/tmp/

info: [debug] Pushing settings apk to device...

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/settings_apk/settings_apk-debug.apk"

info: [debug] Pushing unlock helper app to device...

info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY install "/Applications/Appium.app/Contents/Resources/node_modules/appium/build/unlock_apk/unlock_apk-debug.apk"

info: Starting App

info: [debug] Attempting to kill all 'uiautomator' processes
info: [debug] Getting all processes with 'uiautomator'
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "ps 'uiautomator'"

info: [debug] No matching processes found

info: [debug] Running bootstrap
info: [debug] spawning: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1

info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
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] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "dumpsys window"

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] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data\/local\/tmp","status":0}
info: [debug] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
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: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "getprop ro.build.version.sdk"

info: [debug] Device is at API Level 17
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.dianping.v1/com.dianping.main.guide.SplashScreenActivity"

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: <-- GET /wd/hub/status 200 3.736 ms - 155 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: [debug] Waiting for pkg "com.dianping.v1" and activity "com.dianping.main.guide.SplashScreenActivity" to be focused

info: [debug] Getting focused package and activity
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "dumpsys window windows"

info: [debug] Device launched! Ready for commands

info: [debug] Setting command timeout to the default of 7200 secs
info: [debug] Appium session started with sessionId b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5

info: <-- POST /wd/hub/session 303 8166.038 ms - 74 
info: --> GET /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5 {}
info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"deviceName":"351BBJNGTRWY","app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","autoLaunch":true,"platformVersion":"4.2","appPackage":"com.dianping.v1","platformName":"Android","appActivity":"com.dianping.main.guide.SplashScreenActivity"},"deviceName":"351BBJNGTRWY","app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","autoLaunch":true,"appPackage":"com.dianping.v1","platformName":"Android","appActivity":"com.dianping.main.guide.SplashScreenActivity"},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}
info: <-- GET /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5 200 1.450 ms - 813 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"4.2","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"deviceName":"351BBJNGTRWY","app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","autoLaunch":true,"platformVersion":"4.2","appPackage":"com.dianping.v1","platformName":"Android","appActivity":"com.dianping.main.guide.SplashScreenActivity"},"deviceName":"351BBJNGTRWY","app":"/Users/ting/cop_files/evolution/appium/Nova_7.5.0_debug.apk","autoLaunch":true,"appPackage":"com.dianping.v1","platformName":"Android","appActivity":"com.dianping.main.guide.SplashScreenActivity"},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: --> POST /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5/element {"using":"xpath","sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5","value":"//android.widget.TextView[contains(@text,'上海')]"}

info: [debug] Waiting up to 0ms for condition

info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.widget.TextView[contains(@text,'上海')]","context":"","multiple":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.widget.TextView[contains(@text,'上海')]","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 //android.widget.TextView[contains(@text,'上海')] using XPATH with the contextId:  multiple: false

info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.widget.TextView, INSTANCE=3]

info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"1"},"status":0}

info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}
info: <-- POST /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5/element 200 835.630 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: --> POST /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5/element/1/click {"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5","id":"1"}
info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"1"}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"1"}}
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":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}
info: <-- POST /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5/element/1/click 200 394.520 ms - 76 {"status":0,"value":true,"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: --> DELETE /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5 {}
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: /Users/ting/software/adt-bundle-mac-x86_64-20140702/sdk/platform-tools/adb -s 351BBJNGTRWY shell "input keyevent 3"

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}
info: [debug] [BOOTSTRAP] [debug] Closed client connection
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
info: [debug] [UIAUTOMATOR STDOUT] Test results for UiAutomatorTestRunner=.
info: [debug] [UIAUTOMATOR STDOUT] Time: 18.148
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1

info: [debug] UiAutomator shut down normally
info: [debug] Cleaning up android objects
info: [debug] Cleaning up appium session
info: [debug] Responding to client with success: {"status":0,"value":null,"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}
info: <-- DELETE /wd/hub/session/b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5 200 768.028 ms - 76 {"status":0,"value":null,"sessionId":"b7c59dd7-66fe-4ab7-8c5f-5d0dc43c5ea5"}

info: --> GET /wd/hub/status {}

info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}
info: <-- GET /wd/hub/status 200 0.707 ms - 104 {"status":0,"value":{"build":{"version":"1.3.7","revision":"72fbfaa116d3d9f6a862600ee99cf02f6d0e2182"}}}

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM