2016-10-29 2 views
0

Ich habe versucht, eine androide native App mit Selen Webdriver zu automatisieren. Siehe meinen Code unten.Appium Automatisierung mit Java

Allerdings klickt Appium fünf Mal auf den Pin, klickt aber nicht auf den Login-Button außerhalb der Schleife. Appium gibt den Erfolg an den Java-Client (Eclipse) zurück, den ich für den Test verwende.

Bitte gibt es etwas, was ich falsch mache. Ich werde jede Hilfe sehr schätzen.

@Manidroid, bitte appium log unter

> 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 19 --automation-name Appium --device-name "donatello" --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,"deviceName":"donatello","platformName":"Android","platformVersion":"19","automationName":"Appium"} 
> info: Console LogLevel: debug 
> info: --> POST /wd/hub/session {"desiredCapabilities":{"appActivity":"com.myapplicationdev.MainActivity","appPackage":"com.myapplication","platformName":"Android","deviceName":"donatello"}} 
> info: Client User-Agent string: Apache-HttpClient/4.5.1 (Java/1.8.0_101) 
> 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 60ee80cd-ab62-4dcd-8e18-aac9de15aed6 
> info: Starting android appium 
> info: [debug] Getting Java version 
> info: Java version is: 1.8.0_101 
> info: [debug] Checking whether adb is present 
> info: [debug] Using adb from C:\Users\Eagle\Desktop\Appium\Installations and Configuration\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: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" devices 
> info: [debug] 1 device(s) connected 
> info: Found device 169.254.160.177:5555 
> info: [debug] Setting device id to 169.254.160.177:5555 
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5) 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 wait-for-device 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 shell "echo 'ready'" 
> info: [debug] Starting logcat capture 
> info: [debug] Getting device API level 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 forward tcp:4724 tcp:4724 
> info: [debug] Pushing appium bootstrap to device... 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/ 
> info: [debug] Pushing settings apk to device... 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 install "C:\Program Files (x86)\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: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 shell "ps 'uiautomator'" 
> info: [debug] No matching processes found 
> info: [debug] Running bootstrap 
> info: [debug] spawning: C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe -s 169.254.160.177:5555 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.myapplicationdev -e disableAndroidWatchers false 
> info: [debug] [UIAUTOMATOR STDOUT] WARNING: linker: libdvm.so has text relocations. This is wasting memory and is a security risk. Please fix. 
> 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] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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] [BOOTSTRAP] [debug] Got command of type ACTION 
> info: [debug] dataDir set to: /data 
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"\/data","status":0} 
> info: [debug] Getting device API level 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 shell "getprop ro.build.version.sdk" 
> 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] Device is at API Level 19 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.myapplicationdev/com.myapplicationdev.MainActivity" 
> info: [debug] Waiting for pkg "com.myapplicationdev" and activity "com.myapplicationdev.MainActivity" to be focused 
> info: [debug] Getting focused package and activity 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 shell "dumpsys window windows" 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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 60ee80cd-ab62-4dcd-8e18-aac9de15aed6 
> info: <-- POST /wd/hub/session 303 12203.233 ms - 74 
> info: --> GET /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6 {} 
> 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":{"appActivity":"com.myapplicationdev.MainActivity","appPackage":"com.myapplication","platformName":"Android","deviceName":"donatello"},"appActivity":"com.myapplicationdev.MainActivity","appPackage":"com.myapplication","platformName":"Android","deviceName":"169.254.160.177:5555"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- GET /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6 200 7.357 ms - 644 {"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":{"appActivity":"com.myapplicationdev.MainActivity","appPackage":"com.myapplication","platformName":"Android","deviceName":"donatello"},"appActivity":"com.myapplicationdev.MainActivity","appPackage":"com.myapplication","platformName":"Android","deviceName":"169.254.160.177:5555"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@content-desc='1']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","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.view.View[@content-desc='1'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=4] 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"1"},"status":0} 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"1"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 512.676 ms - 87 {"status":0,"value":{"ELEMENT":"1"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/1/click {"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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/1/click 200 545.815 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@content-desc='1']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","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.view.View[@content-desc='1'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=5] 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"2"},"status":0} 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"2"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 312.892 ms - 87 {"status":0,"value":{"ELEMENT":"2"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/2/click {"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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/2/click 200 635.001 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@content-desc='1']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","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.view.View[@content-desc='1'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=5] 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"3"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 693.547 ms - 87 {"status":0,"value":{"ELEMENT":"3"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"3"},"status":0} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/3/click {"id":"3"} 
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"3"}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"3"}} 
> 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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/3/click 200 457.090 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@content-desc='1']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","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.view.View[@content-desc='1'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=6] 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"4"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 233.350 ms - 87 {"status":0,"value":{"ELEMENT":"4"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"4"},"status":0} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/4/click {"id":"4"} 
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"4"}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"4"}} 
> 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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/4/click 200 437.992 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@content-desc='1']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@content-desc='1']","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.view.View[@content-desc='1'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=7] 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"5"},"status":0} 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"5"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 371.092 ms - 87 {"status":0,"value":{"ELEMENT":"5"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/5/click 200 231.014 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element {"using":"xpath","value":"//android.view.View[@index='2']"} 
> info: [debug] Waiting up to 0ms for condition 
> info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//android.view.View[@index='2']","context":"","multiple":false}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//android.view.View[@index='2']","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.view.View[@index='2'] using XPATH with the contextId: multiple: false 
> info: [debug] [BOOTSTRAP] [debug] Using: UiSelector[CLASS=android.view.View, INSTANCE=3] 
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":{"ELEMENT":"6"},"status":0} 
> info: [debug] Responding to client with success: {"status":0,"value":{"ELEMENT":"6"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element 200 170.945 ms - 87 {"status":0,"value":{"ELEMENT":"6"},"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: --> POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/6/click {"id":"6"} 
> info: [debug] Pushing command to appium work queue: ["element:click",{"elementId":"6"}] 
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"element:click","params":{"elementId":"6"}} 
> 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":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: <-- POST /wd/hub/session/60ee80cd-ab62-4dcd-8e18-aac9de15aed6/element/6/click 200 326.695 ms - 76 {"status":0,"value":true,"sessionId":"60ee80cd-ab62-4dcd-8e18-aac9de15aed6"} 
> info: [debug] Didn't get a new command in 60 secs, shutting down... 
> info: Shutting down appium session 
> info: [debug] Pressing the HOME button 
> info: [debug] executing cmd: "C:\Users\Eagle\Desktop\Appium\Installations and Configuration\android-sdk-windows\platform-tools\adb.exe" -s 169.254.160.177:5555 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] Sent shutdown command, waiting for UiAutomator to stop... 
> 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] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream= 
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=. 
> info: [debug] [UIAUTOMATOR STDOUT] Time: 87.663 
> 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] We shut down because no new commands came in 
+0

Meine beste Vermutung ist, dass der XPath-Ausdruck überein etwas anderes, das anstelle der Login-Schaltfläche geklickt wird. – Robert

+0

Danke Robert, ich glaube wirklich nicht, dass das Problem vom XPath herrührt. Das ist, weil, wenn ich die Anmeldung in die erste Zeile des Codes verschiebe, wurde es angeklickt, und ich bekam ein Pop-Up und forderte mich auf, den 5-stelligen Pin zuerst zu setzen. – ayoaudu

+0

, um die richtige Lösung dafür zu geben, brauchen wir folgende, 1. Volle Appium Logs 2. UIautomator Screenshot – Manidroid

Antwort

0

Können Sie auf die Koordinaten des Elements zu klicken versuchen sehen und zu sehen, ob es funktioniert?

Versuchen so etwas wie dieses -

Point point = element.getLocation(); 
int x = point.x; 
int y = point.y; 

TouchAction touchAction = new TouchAction(driverMobile); 
touchAction.tap(x, y).perform(); 
+0

Dank Anish, mit TouchAction gearbeitet. Ich bemerkte, dass, wenn ich die Kordinate von Punkt aus druckte, ich (179, 424) bekam, so dass es nicht auf den Knopf klickte. aber wenn ich meine Koordinaten manuell mit dem Auto Automator bekam, konnte ich darauf klicken. – ayoaudu

+0

Hi Ayoaudu, waren es die gleichen Koordinaten, die du in beiden Fällen benutzt hast. Generell versuche ich, den Koordinaten einen Versatz von 5 oder 10px hinzuzufügen, so dass es funktioniert, wenn die ursprünglichen Koordinaten die Ecken sind. Also ist der Code, den ich normalerweise verwende - "touchAction.tap (x + 10, y + 10) .perform();' –

+0

Hallo Anish, die Kordel, die ich schließlich verwendete, war anders als das, was ich von Punkt bekam. Point gab mir (179,424), aber ich benutzte (504, 409), dass ich von uiautomator bekam. Ich bin eigentlich besorgt, dass der Code nicht funktioniert, wenn ich ein anderes Gerät verwende, das größer oder kleiner ist. – ayoaudu

Verwandte Themen