Appium 单个用例成功执行,组合成业务流执行出错

April · 2016年03月23日 · 最后由 百事可乐 回复于 2018年11月22日 · 2475 次阅读

环境:python appium
问题:两个单个的用例都能单独成功运行,为啥建成业务流以后,执行完第一个用例以后,退出 app,执行第二个的时候会报错:元素定位错误,找不到元素

代码:

class AppKeyWord(unittest.TestCase, AppExecuteKeyword.Key,Driver.MyDriver):
    def setUp(self):    
        time.sleep(20)
        self.driver = self.get_driver()
        print "get driver" 
        self.verificationErrors = []

    def action(self,case_id, case_name):
        self.AppExecute(case_id, case_name)
        print "finish case"

    @staticmethod
    def getTestFunc(case_id, case_name):
        def func(self):
            self.action(case_id, case_name)
        return func

    def tearDown(self):
        print "-"*70
        print u"用例运行成功"
        time.sleep(5)
        self.driver.quit()
        print "quit driver"
        self.assertEqual([], self.verificationErrors)

日志

```shell
> Checking if an update is available
> Update not available
> Launching Appium server with command: E:\appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 17 --automation-name Appium --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> 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":"17","automationName":"Appium"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"platformVersion":"4.4.4\r\n","appPackage":"com.jinlufinancial.android.prometheus","platformName":"Android","appActivity":"com.jinlufinancial.android.prometheus.StartMovieActivity","deviceName":"b3413520"}}
> info: Client User-Agent string: Python-urllib/2.7
> info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
> info: [debug] Creating new appium session 98ab7e67-6ea4-492b-babc-eaf84210f9f3
> 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 E:\android\android-sdk-windows\platform-tools\adb.exe
> warn: No app capability, can't parse package/activity
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device b3413520
> info: [debug] Setting device id to b3413520
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 wait-for-device
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
> info: Device API level is: 19
> info: [debug] Extracting strings for language: default
> info: [debug] Apk doesn't exist locally
> info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "rm -rf /data/local/tmp/strings.json"
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Skipping install since we launched with a package instead of an app path
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 push "E:\\appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 install "E:\appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 install "E:\appium\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: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.jinlufinancial.android.prometheus -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] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> 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: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 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: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 19
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.jinlufinancial.android.prometheus/com.jinlufinancial.android.prometheus.StartMovieActivity"
> info: [debug] Waiting for pkg "com.jinlufinancial.android.prometheus" and activity "com.jinlufinancial.android.prometheus.StartMovieActivity" to be focused
> info: [debug] Getting focused package and activity
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 shell "dumpsys window windows"
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 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
> info: [debug] Appium session started with sessionId 98ab7e67-6ea4-492b-babc-eaf84210f9f3
> info: <-- POST /wd/hub/session 303 52212.751 ms - 74 
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 {}
> 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":{"platformVersion":"4.4.4\r\n","appPackage":"com.jinlufinancial.android.prometheus","platformName":"Android","appActivity":"com.jinlufinancial.android.prometheus.StartMovieActivity","deviceName":"b3413520"},"appPackage":"com.jinlufinancial.android.prometheus","platformName":"Android","appActivity":"com.jinlufinancial.android.prometheus.StartMovieActivity","deviceName":"b3413520"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 200 2.637 ms - 709 {"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":{"platformVersion":"4.4.4\r\n","appPackage":"com.jinlufinancial.android.prometheus","platformName":"Android","appActivity":"com.jinlufinancial.android.prometheus.StartMovieActivity","deviceName":"b3413520"},"appPackage":"com.jinlufinancial.android.prometheus","platformName":"Android","appActivity":"com.jinlufinancial.android.prometheus.StartMovieActivity","deviceName":"b3413520"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
> info: [debug] [BOOTSTRAP] [debug] Finding com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"No element found","status":7}
> info: [debug] Condition unmet after 1060ms. Timing out.
> info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"No element found"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 500 1061.943 ms - 195 
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
> info: [debug] [BOOTSTRAP] [debug] Finding com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"No element found","status":7}
> info: [debug] Condition unmet after 32ms. Timing out.
> info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"No element found"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 500 32.573 ms - 195 
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
> info: [debug] [BOOTSTRAP] [debug] Finding com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"No element found","status":7}
> info: [debug] Condition unmet after 38ms. Timing out.
> info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"No element found"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 500 39.507 ms - 195 
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
> info: [debug] [BOOTSTRAP] [debug] Finding com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"No element found","status":7}
> info: [debug] Condition unmet after 58ms. Timing out.
> info: [debug] Responding to client with error: {"status":7,"value":{"message":"An element could not be located on the page using the given search parameters.","origValue":"No element found"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 500 59.234 ms - 195 
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"1"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 398.867 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/1/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"1","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"1","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/1/displayed 200 1355.201 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_two"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/icon_two","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 com.jinlufinancial.android.prometheus:id/icon_two using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/icon_two]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"2"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"2"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 72.268 ms - 87 {"status":0,"value":{"ELEMENT":"2"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/2/click {"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","id":"2"}
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"2"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"2"}}
> 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":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/2/click 200 398.529 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/teledt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","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 com.jinlufinancial.android.prometheus:id/teledt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/teledt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"3"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"3"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 36.993 ms - 87 {"status":0,"value":{"ELEMENT":"3"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/3/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"3","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"3","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/3/displayed 200 34.102 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/teledt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","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 com.jinlufinancial.android.prometheus:id/teledt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/teledt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"4"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"4"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 44.525 ms - 87 {"status":0,"value":{"ELEMENT":"4"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/4/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"4","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"4","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/4/displayed 200 57.990 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/teledt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/teledt","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 com.jinlufinancial.android.prometheus:id/teledt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/teledt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"5"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"5"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 30.641 ms - 87 {"status":0,"value":{"ELEMENT":"5"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/5/value {"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","id":"5","value":["1","3","8","1","6","2","4","4","9","5","6"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"5","text":"13816244956","replace":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"5","text":"13816244956","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] [UIAUTOMATOR STDOUT] java.io.FileNotFoundException: /data/system/theme_config/theme_compatibility.xml: open failed: ENOENT (No such file or directory)
> info: [debug] [UIAUTOMATOR STDOUT] at libcore.io.IoBridge.open(IoBridge.java:409)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] java.io.FileInputStream.<init>(FileInputStream.java:78)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] java.io.FileInputStream.<init>(FileInputStream.java:105)
> info: [debug] [UIAUTOMATOR STDOUT] at java.io.FileReader.<init>(FileReader.java:66)
> info: [debug] [UIAUTOMATOR STDOUT] at miui.content.res.ThemeCompatibilityLoader.getVersion(ThemeCompatibilityLoader.java:108)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] miui.content.res.ThemeCompatibilityLoader.getConfigDocumentTree(ThemeCompatibilityLoader.java:126)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] miui.content.res.ThemeCompatibilityLoader.loadConfig(ThemeCompatibilityLoader.java:59)
> info: [debug] [UIAUTOMATOR STDOUT] at miui.content.res.ThemeCompatibility.<clinit>(ThemeCompatibility.java:31)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] android.content.res.MiuiResources.<clinit>(MiuiResources.java:29)
> info: [debug] [UIAUTOMATOR STDOUT] at android.content.res.Resources.getSystem(Resources.java:221)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] android.database.CursorWindow.<clinit>(CursorWindow.java:47)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] android.database.BulkCursorDescriptor.readFromParcel(BulkCursorDescriptor.java:75)
> info: [debug] [UIAUTOMATOR STDOUT] at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:34)
> info: [debug] [UIAUTOMATOR STDOUT] at android.database.BulkCursorDescriptor$1.createFromParcel(BulkCursorDescriptor.java:30)
> info: [debug] [UIAUTOMATOR STDOUT] at android.content.ContentProviderProxy.query(ContentProviderNative.java:416)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.ShellUiAutomatorBridge.getSystemLongPressTime(ShellUiAutomatorBridge.java:69)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] com.android.uiautomator.core.InteractionController.longTapNoSync(InteractionController.java:296)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.core.UiObject.clearTextField(UiObject.java:626)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.AndroidElement.clearText(AndroidElement.java:38)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.handler.Clear.execute(Clear.java:54)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.handler.SetText.execute(SetText.java:62)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.AndroidCommandExecutor.execute(AndroidCommandExecutor.java:64)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.runCommand(SocketServer.java:172)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.SocketServer.handleClientData(SocketServer.java:89)
> info: [debug] [UIAUTOMATOR STDOUT] at io.appium.android.bootstrap.SocketServer.listenForever(SocketServer.java:137)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap.testRunServer(Bootstrap.java:20)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] java.lang.reflect.Method.invokeNative(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at java.lang.reflect.Method.invoke(Method.java:515)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] junit.framework.TestCase.runTest(TestCase.java:168)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] junit.framework.TestCase.runBare(TestCase.java:134)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] junit.framework.TestResult$1.protect(TestResult.java:115)
> info: [debug] [UIAUTOMATOR STDOUT] at junit.framework.TestResult.runProtected(TestResult.java:133)
> info: [debug] [UIAUTOMATOR STDOUT] at junit.framework.TestResult.run(TestResult.java:118)
> info: [debug] [UIAUTOMATOR STDOUT] at junit.framework.TestCase.run(TestCase.java:124)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] com.android.uiautomator.testrunner.UiAutomatorTestRunner.start(UiAutomatorTestRunner.java:160)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.uiautomator.testrunner.UiAutomatorTestRunner.run(UiAutomatorTestRunner.java:96)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] com.android.commands.uiautomator.RunTestCommand.run(RunTestCommand.java:91)
> info: [debug] [UIAUTOMATOR STDOUT] at com.android.commands.uiautomator.Launcher.main(Launcher.java:83)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] com.android.internal.os.RuntimeInit.main(RuntimeInit.java:245)
> info: [debug] [UIAUTOMATOR STDOUT] at dalvik.system.NativeStart.main(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] Caused by:
> info: [debug] [UIAUTOMATOR STDOUT] libcore.io.ErrnoException: open failed: ENOENT (No such file or directory)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] libcore.io.Posix.open(Native Method)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] libcore.io.BlockGuardOs.open(BlockGuardOs.java:110)
> info: [debug] [UIAUTOMATOR STDOUT] at
> info: [debug] [UIAUTOMATOR STDOUT] libcore.io.IoBridge.open(IoBridge.java:393)
> info: [debug] [UIAUTOMATOR STDOUT] ...
> info: [debug] [UIAUTOMATOR STDOUT] 40
> info: [debug] [UIAUTOMATOR STDOUT] more
> 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: 13816244956
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/5/value 200 7422.070 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/loginpswedt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","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 com.jinlufinancial.android.prometheus:id/loginpswedt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/loginpswedt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"6"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"6"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 52.762 ms - 87 {"status":0,"value":{"ELEMENT":"6"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/6/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"6","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"6","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/6/displayed 200 55.850 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/loginpswedt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","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 com.jinlufinancial.android.prometheus:id/loginpswedt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/loginpswedt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"7"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"7"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 56.403 ms - 87 {"status":0,"value":{"ELEMENT":"7"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/7/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"7","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"7","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/7/displayed 200 43.066 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/loginpswedt"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginpswedt","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 com.jinlufinancial.android.prometheus:id/loginpswedt using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/loginpswedt]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"8"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"8"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 63.007 ms - 87 {"status":0,"value":{"ELEMENT":"8"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/8/value {"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","id":"8","value":["l","i","u","x","i","n","y","a","n","g","1","2","3","4"]}
> info: [debug] Pushing command to appium work queue: ["element:setText",{"elementId":"8","text":"liuxinyang1234","replace":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"8","text":"liuxinyang1234","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: liuxinyang1234
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":true,"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/8/value 200 6985.681 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/loginbtn"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginbtn","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginbtn","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 com.jinlufinancial.android.prometheus:id/loginbtn using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/loginbtn]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"9"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"9"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 35.472 ms - 87 {"status":0,"value":{"ELEMENT":"9"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/9/displayed {}
> info: [debug] Pushing command to appium work queue: ["element:getAttribute",{"elementId":"9","attribute":"displayed"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:getAttribute","params":{"elementId":"9","attribute":"displayed"}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getAttribute
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"true","status":0}
> info: [debug] Responding to client with success: {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/9/displayed 200 42.184 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/loginbtn"}
> info: [debug] Waiting up to 0ms for condition
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginbtn","context":"","multiple":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.jinlufinancial.android.prometheus:id/loginbtn","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 com.jinlufinancial.android.prometheus:id/loginbtn using ID with the contextId:  multiple: false
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.jinlufinancial.android.prometheus:id/loginbtn]
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"10"},"status":0}
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"10"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 200 33.625 ms - 88 {"status":0,"value":{"ELEMENT":"10"},"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/10/click {"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","id":"10"}
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"10"}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"10"}}
> 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":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element/10/click 200 204.247 ms - 76 {"status":0,"value":true,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> DELETE /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 {}
> info: Shutting down appium session
> info: [debug] Pressing the HOME button
> info: [debug] executing cmd: E:\android\android-sdk-windows\platform-tools\adb.exe -s b3413520 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: 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] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 39.816
> 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":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: <-- DELETE /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 200 741.585 ms - 76 {"status":0,"value":null,"sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3"}
> info: --> POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element {"using":"id","sessionId":"98ab7e67-6ea4-492b-babc-eaf84210f9f3","value":"com.jinlufinancial.android.prometheus:id/icon_three"}
> info: <-- POST /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/element 404 0.754 ms - 40 
> info: --> GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/screenshot {}
> info: <-- GET /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3/screenshot 404 0.465 ms - 40 
> info: --> DELETE /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 {}
> info: <-- DELETE /wd/hub/session/98ab7e67-6ea4-492b-babc-eaf84210f9f3 404 0.482 ms - 40 

共收到 17 条回复 时间 点赞

@mymgbady
先代那群大佬提醒你,測試用例代碼跟執行 log 要貼出來。

嗯,说明上下文再放出来

#2 楼 @monkey 已修改

不是都提示找不到元素了么。。

#4 楼 @huanzhijin 这两个用例可以单独运行的。只不过弄成业务流以后。第一个用例执行完了会推出 app,执行第二个用例时并没有重新打开 app,可是他执行了 get——driver 函数,为什么打不开应用?从而导致定位不到元素

你说的退出是怎样的退出???

#6 楼 @huanzhijin 直接回到主界面

#7 楼 @mymgbaby 那你再启动下 app 不就行了?

self.get_driver() 你自己封装的这个方法包括了启动测试 app 吗?

1、一千个人有一千种封装方法,看这种代码猜不出到底 appium 干了什么
2、那就看 server log 吧,不知道什么奇怪的写法,查找元素执行了很多遍,虽然开始报了很多错,但最终还是找到元素了
3、那继续往下看吧,在id/teledt输入13816244956,成功了,在id/loginpswedt输入liuxinyang1234,成功了,点击id/loginbtn,成功了
4、再往下,删除了 id 是98ab7e67-6ea4-492b-babc-eaf84210f9f3的 session ,正常关闭了 appium
5、再往下,用被删除的 session 98ab7e67-6ea4-492b-babc-eaf84210f9f3查找id/icon_three,截图,又删除 98ab7e67-6ea4-492b-babc-eaf84210f9f3
6、下面没了

April #11 · 2016年03月25日 Author

#10 楼 @sanlengjingvv 好棒!麻烦你再帮我看下这个错是什么原因吧

你的截图最后一行

你好,这个问题你解决了吗?我最近也遇到这个问题了

April #14 · 2016年04月21日 Author

#13 楼 @hyman 加上 setup()和 teardown() 试试

#14 楼 @mymgbaby 有 setup() 和 teardown(),你可以看下这个帖子https://testerhome.com/topics/4681, 感觉是 session 的问题

匿名 #16 · 2016年06月29日

这个问题你解决了吗

楼主,这个问题解决了么,我也是这问题,一开始一直在执行查找元素,找了估计 30 秒才找到,我是用 id 定位的这个页面 id 是唯一的,
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/dg_title","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/dg_title","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.wendu.kaoyan:id/dg_title' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.wendu.kaoyan:id/dg_title]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.wendu.kaoyan:id/dg_title' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.wendu.kaoyan:id/dg_title]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":7,"value":"No element found"}
[AndroidBootstrap] Received command result from bootstrap
[MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
[W3C] Encountered internal error running command: NoSuchElementError: An element could not be located on the page using the given search parameters.
[W3C] at AndroidDriver.callee$0$0$ (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\appium-android-driver\lib\commands\find.js:75:11)
[W3C] at tryCatch (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:67:40)
[W3C] at GeneratorFunctionPrototype.invoke as _invoke
[W3C] at GeneratorFunctionPrototype.prototype.(anonymous function) as throw
[W3C] at GeneratorFunctionPrototype.invoke (C:\Program Files (x86)\Appium\resources\app\node_modules\appium\node_modules\babel-runtime\regenerator\runtime.js:136:37)
[W3C] at run (C:\Program Files (x86)\Appium\resources\app\webpack:~\babel-polyfill~\core-js\modules\es6.promise.js:75:1)
[W3C] at C:\Program Files (x86)\Appium\resources\app\webpack:~\babel-polyfill~\core-js\modules\es6.promise.js:92:1
[W3C] at flush (C:\Program Files (x86)\Appium\resources\app\webpack:~\babel-polyfill~\core-js\modules_microtask.js:18:1)
[W3C] at process._tickCallback (internal/process/next_tick.js:61:11)
[HTTP] <-- POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element 404 60523 ms - 1599
[HTTP]
[HTTP] --> POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element
[HTTP] {"using":"id","value":"com.wendu.kaoyan:id/ed_serach","sessionId":"8185e0ed-66a7-42d1-837a-13502ef87bd7"}
[W3C] Calling AppiumDriver.findElement() with args: ["id","com.wendu.kaoyan:id/ed_serach","8185e0ed-66a7-42d1-837a-13502ef87bd7"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 60000 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/ed_serach","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/ed_serach","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.wendu.kaoyan:id/ed_serach' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.wendu.kaoyan:id/ed_serach]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"19"}}
[AndroidBootstrap] Received command result from bootstrap
[W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"19"}
[HTTP] <-- POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element 200 27 ms - 54
[HTTP]
[HTTP] --> POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element/19/click
[HTTP] {"id":"19","sessionId":"8185e0ed-66a7-42d1-837a-13502ef87bd7"}
[W3C] Calling AppiumDriver.click() with args: ["19","8185e0ed-66a7-42d1-837a-13502ef87bd7"]
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:click","params":{"elementId":"19"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"19"}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: click
[AndroidBootstrap] Received command result from bootstrap
[W3C] Responding to client with driver.click() result: true
[HTTP] <-- POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element/19/click 200 151 ms - 14
[HTTP]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":true}
[HTTP] --> POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/timeouts
[HTTP] {"implicit":60000,"sessionId":"8185e0ed-66a7-42d1-837a-13502ef87bd7"}
[W3C] Calling AppiumDriver.timeouts() with args: [null,null,null,null,60000,"8185e0ed-66a7-42d1-837a-13502ef87bd7"]
[BaseDriver] W3C timeout argument: {"implicit":60000}}
[BaseDriver] Set implicit wait to 60000ms
[W3C] Responding to client with driver.timeouts() result: null
[HTTP] <-- POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/timeouts 200 2 ms - 14
[HTTP]
[HTTP] --> POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element
[HTTP] {"using":"id","value":"com.wendu.kaoyan:id/ed_serach","sessionId":"8185e0ed-66a7-42d1-837a-13502ef87bd7"}
[W3C] Calling AppiumDriver.findElement() with args: ["id","com.wendu.kaoyan:id/ed_serach","8185e0ed-66a7-42d1-837a-13502ef87bd7"]
[BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[BaseDriver] Waiting up to 60000 ms for condition
[AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/ed_serach","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"com.wendu.kaoyan:id/ed_serach","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'com.wendu.kaoyan:id/ed_serach' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.wendu.kaoyan:id/ed_serach]
[AndroidBootstrap] Received command result from bootstrap
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"20"}}
[W3C] Responding to client with driver.findElement() result: {"element-6066-11e4-a52e-4f735466cecf":"20"}
[HTTP] <-- POST /wd/hub/session/8185e0ed-66a7-42d1-837a-13502ef87bd7/element 200 605 ms - 54

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册