Appium driver cannot be able to find elements. Please find the log and also the code base


#1

Appium log:

2018-08-08 21:31:45:755 - info: [Appium] Welcome to Appium v1.8.1
2018-08-08 21:31:45:757 - info: [Appium] Non-default server args:
2018-08-08 21:31:45:758 - info: [Appium] address: 127.0.0.1
2018-08-08 21:31:45:758 - info: [Appium] sessionOverride: true
2018-08-08 21:31:45:758 - info: [Appium] log: C:\Users\892475\AppiumServerLogs.txt
2018-08-08 21:31:45:802 - info: [Appium] Appium REST http interface listener started on 127.0.0.1:4723
2018-08-08 21:31:46:160 - info: [HTTP] --> GET /wd/hub/status
2018-08-08 21:31:46:160 - info: [HTTP] {}
2018-08-08 21:31:46:165 - info: [debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
2018-08-08 21:31:46:215 - info: [debug] [MJSONWP] Responding to client with driver.getStatus() result: {“build”:{“version”:“1.8.1”,“revision”:null}}
2018-08-08 21:31:46:219 - info: [HTTP] <-- GET /wd/hub/status 200 57 ms - 83
2018-08-08 21:31:46:219 - info: [HTTP]
2018-08-08 21:31:51:179 - info: [HTTP] --> POST /wd/hub/session
2018-08-08 21:31:51:179 - info: [HTTP] {“desiredCapabilities”:{“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appPackage”:“com.aa.mobileCCIv4”,“rotatable”:true,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“deviceName”:“Android Emulator”,“fullReset”:true,“avd”:“DEMO”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“newCommandTimeout”:“100”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“platformName”:“Android”},“capabilities”:{“desiredCapabilities”:{“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“appPackage”:“com.aa.mobileCCIv4”,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“autoGrantPermissions”:“true”,“avd”:“DEMO”,“deviceName”:“Android Emulator”,“fullReset”:true,“newCommandTimeout”:“100”,“platformName”:“Android”,“rotatable”:true,“takesScreenshot”:true},“firstMatch”:[{“platformName”:“android”}]}}
2018-08-08 21:31:51:180 - info: [debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appPackage”:“com.aa.mobileCCIv4”,“rotatable”:true,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“deviceName”:“Android Emulator”,“fullReset”:true,“avd”:“DEMO”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“newCommandTimeout”:“100”,“autoGrantPermissions”:“true”,“takesScreenshot”:true,“platformName”:“Android”},null,{“desiredCapabilities”:{“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“appPackage”:“com.aa.mobileCCIv4”,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“autoGrantPermissions”:“true”,“avd”:“DEMO”,“deviceName”:“Android Emulator”,“fullReset”:true,“newCommandTimeout”:“100”,“platformName”:“Android”,“rotatable”:true,“takesScreenshot”:true},“firstMatch”:[{“platformName”:“android”}]}]
2018-08-08 21:31:51:180 - info: [debug] [BaseDriver] Event ‘newSessionRequested’ logged at 1533763911180 (16:31:51 GMT-0500 (Central Daylight Time))
2018-08-08 21:31:51:186 - warn: [Appium] Could not parse W3C capabilities: ‘deviceName’ can’t be blank. Falling back to JSONWP protocol.
2018-08-08 21:31:51:187 - warn: [Appium] The following capabilities were provided in the JSONWP desired capabilities that are missing in W3C capabilities: [“app”,“appPackage”,“rotatable”,“appWaitActivity”,“deviceName”,“fullReset”,“avd”,“appActivity”,“newCommandTimeout”,“autoGrantPermissions”,“takesScreenshot”,“platformName”]. Falling back to JSONWP protocol.
2018-08-08 21:31:51:189 - info: [Appium] Creating new AndroidDriver (v2.7.0) session
2018-08-08 21:31:51:189 - info: [Appium] Capabilities:
2018-08-08 21:31:51:190 - info: [Appium] app: D:\workspaces\ccimobileautomation\src\app-release.apk
2018-08-08 21:31:51:190 - info: [Appium] appPackage: com.aa.mobileCCIv4
2018-08-08 21:31:51:190 - info: [Appium] rotatable: true
2018-08-08 21:31:51:190 - info: [Appium] appWaitActivity: com.aa.mobileCCIv4.MainActivity
2018-08-08 21:31:51:190 - info: [Appium] deviceName: Android Emulator
2018-08-08 21:31:51:190 - info: [Appium] fullReset: true
2018-08-08 21:31:51:190 - info: [Appium] avd: DEMO
2018-08-08 21:31:51:190 - info: [Appium] appActivity: com.aa.mobileCCIv4.MainActivity
2018-08-08 21:31:51:190 - info: [Appium] newCommandTimeout: 100
2018-08-08 21:31:51:191 - info: [Appium] autoGrantPermissions: true
2018-08-08 21:31:51:191 - info: [Appium] takesScreenshot: true
2018-08-08 21:31:51:191 - info: [Appium] platformName: Android
2018-08-08 21:31:51:195 - info: [debug] [BaseDriver] Creating session with MJSONWP desired capabilities: {“app”:"D:\workspaces\cci…
2018-08-08 21:31:51:196 - warn: [BaseDriver] Capability ‘autoGrantPermissions’ changed from string to boolean. This may cause unexpected behavior
2018-08-08 21:31:51:196 - warn: [BaseDriver] Capability ‘newCommandTimeout’ changed from string (‘100’) to integer (100). This may cause unexpected behavior
2018-08-08 21:31:51:199 - warn: [BaseDriver] The following capabilities were provided, but are not recognized by appium: rotatable, takesScreenshot.
2018-08-08 21:31:51:200 - info: [BaseDriver] Session created with session id: fc54d99c-e668-4011-899f-7ed31ef9b6fd
2018-08-08 21:31:51:200 - info: [debug] [AndroidDriver] Getting Java version
2018-08-08 21:31:51:322 - info: [AndroidDriver] Java version is: 1.8.0_181

2018-08-08 21:31:51:325 - info: [ADB] Checking whether adb is present
2018-08-08 21:31:51:332 - info: [ADB] Found 2 ‘build-tools’ folders under ‘C:\Users\892475\AppData\Local\Android\Sdk’ (newest first):
2018-08-08 21:31:51:333 - info: [ADB] C:/Users/892475/AppData/Local/Android/Sdk/build-tools/28.0.1
2018-08-08 21:31:51:333 - info: [ADB] C:/Users/892475/AppData/Local/Android/Sdk/build-tools/27.0.3
2018-08-08 21:31:51:334 - info: [ADB] Using adb.exe from C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe
2018-08-08 21:31:51:335 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:51:335 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:51:336 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:51:375 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:51:375 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:51:375 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:51:377 - info: [debug] [ADB] Launching Emulator with AVD DEMO, launchTimeout 60000ms and readyTimeout 60000ms
2018-08-08 21:31:51:377 - info: [ADB] Checking whether emulator is present
2018-08-08 21:31:51:379 - info: [ADB] Using emulator.exe from C:\Users\892475\AppData\Local\Android\Sdk\emulator\emulator.exe
2018-08-08 21:31:51:408 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\emulator\emulator.exe’ with args: ["-avd",“DEMO”]
2018-08-08 21:31:51:427 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:51:427 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:51:427 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:51:469 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:51:469 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:51:469 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:51:671 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:51:671 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:51:672 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:51:713 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:51:713 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:51:713 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:51:915 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:51:915 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:51:915 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:51:956 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:51:956 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:51:956 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:52:157 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:52:157 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:52:157 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:52:206 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:52:206 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:52:206 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:52:267 - info: [ADB] [AVD OUTPUT] RegGetValueW failed 2 The system cannot find the file specified.

2018-08-08 21:31:52:267 - info: [ADB] [AVD OUTPUT]

2018-08-08 21:31:52:268 - info: [ADB] [AVD OUTPUT] RegGetValueW failed 2 The system cannot find the file specified.

2018-08-08 21:31:52:268 - info: [ADB] [AVD OUTPUT]

2018-08-08 21:31:52:268 - info: [ADB] [AVD OUTPUT] HAX is working and emulator runs in fast virt mode.

2018-08-08 21:31:52:407 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:52:408 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:52:408 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:52:471 - info: [debug] [ADB] 0 device(s) connected
2018-08-08 21:31:52:471 - info: [debug] [ADB] 0 emulator(s) connected
2018-08-08 21:31:52:471 - info: [debug] [ADB] Emulator DEMO not running
2018-08-08 21:31:52:672 - info: [debug] [ADB] Trying to find DEMO emulator
2018-08-08 21:31:52:672 - info: [debug] [ADB] Getting connected emulators
2018-08-08 21:31:52:672 - info: [debug] [ADB] Getting connected devices…
2018-08-08 21:31:52:787 - info: [debug] [ADB] 1 device(s) connected
2018-08-08 21:31:52:788 - info: [debug] [ADB] 1 emulator(s) connected
2018-08-08 21:31:52:788 - info: [debug] [ADB] Sending telnet command to device: avd name
2018-08-08 21:31:52:789 - info: [debug] [ADB] Getting running emulator port
2018-08-08 21:31:52:799 - info: [debug] [ADB] Socket connection to device created
2018-08-08 21:31:53:234 - info: [ADB] [AVD OUTPUT] emulator: emula
2018-08-08 21:31:53:235 - info: [ADB] [AVD OUTPUT] tor window was out of view and was recentered

2018-08-08 21:31:53:235 - info: [ADB] [AVD OUTPUT]

2018-08-08 21:31:53:280 - info: [debug] [ADB] Socket connection to device ready
2018-08-08 21:31:53:288 - info: [debug] [ADB] Telnet command got response: DEMO
2018-08-08 21:31:53:293 - info: [debug] [ADB] Found emulator DEMO in port 5554
2018-08-08 21:31:53:293 - info: [debug] [ADB] Setting device id to emulator-5554
2018-08-08 21:31:53:294 - info: [debug] [ADB] Waiting until emulator is ready
2018-08-08 21:31:53:295 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop init.svc.bootanim’
2018-08-08 21:31:53:352 - info: [ADB] [AVD OUTPUT] Your emulator is out of date, please update by launching Android Studio:

2018-08-08 21:31:53:352 - info: [ADB] [AVD OUTPUT] - Start Android Studio

2018-08-08 21:31:53:353 - info: [ADB] [AVD OUTPUT] - Select menu “Tools > Android > SDK Manager”

2018-08-08 21:31:53:353 - info: [ADB] [AVD OUTPUT] - Click “SDK Tools” tab

2018-08-08 21:31:53:353 - info: [ADB] [AVD OUTPUT] - Check “Android Emulator” checkbox

2018-08-08 21:31:53:353 - info: [ADB] [AVD OUTPUT] - Click “OK”

2018-08-08 21:31:53:353 - info: [ADB] [AVD OUTPUT]

2018-08-08 21:31:53:393 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop init.svc.bootanim’
2018-08-08 21:31:56:499 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop init.svc.bootanim’
2018-08-08 21:31:56:545 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop init.svc.bootanim’
2018-08-08 21:31:59:591 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop init.svc.bootanim’
2018-08-08 21:31:59:698 - info: [AndroidDriver] Using device: emulator-5554
2018-08-08 21:31:59:699 - info: [debug] [ADB] Setting device id to emulator-5554
2018-08-08 21:31:59:704 - info: [BaseDriver] Using local app ‘D:\workspaces\ccimobileautomation\src\app-release.apk’
2018-08-08 21:31:59:704 - info: [debug] [AndroidDriver] Checking whether app is actually present
2018-08-08 21:31:59:706 - info: [AndroidDriver] Starting Android session
2018-08-08 21:31:59:707 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 wait-for-device’
2018-08-08 21:31:59:803 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell echo ping’
2018-08-08 21:31:59:900 - warn: [AndroidDriver] setDeviceLanguageCountry requires language or country.
2018-08-08 21:31:59:901 - warn: [AndroidDriver] Got language: ‘null’ and country: ‘null’
2018-08-08 21:31:59:902 - info: [debug] [Logcat] Starting logcat capture
2018-08-08 21:31:59:956 - info: [debug] [AndroidDriver] Pushing unlock helper app to device…
2018-08-08 21:31:59:958 - info: [debug] [ADB] Getting install status for io.appium.unlock
2018-08-08 21:31:59:958 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages io.appium.unlock’
2018-08-08 21:32:00:343 - info: [debug] [ADB] App is installed
2018-08-08 21:32:00:343 - info: [debug] [ADB] Getting package info for ‘io.appium.unlock’
2018-08-08 21:32:00:344 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys package io.appium.unlock’
2018-08-08 21:32:00:404 - info: [ADB] Checking whether aapt is present
2018-08-08 21:32:00:406 - info: [ADB] Using aapt.exe from C:\Users\892475\AppData\Local\Android\Sdk\build-tools\28.0.1\aapt.exe
2018-08-08 21:32:00:442 - info: [debug] [ADB] The installed ‘io.appium.unlock’ package does not require upgrade (‘2.0.0’ >= ‘2.0.0’)
2018-08-08 21:32:00:442 - info: [ADB] Getting device platform version
2018-08-08 21:32:00:443 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.release’
2018-08-08 21:32:00:492 - info: [debug] [ADB] Current device property ‘ro.build.version.release’: 8.1.0
2018-08-08 21:32:00:493 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell wm size’
2018-08-08 21:32:00:787 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.product.model’
2018-08-08 21:32:00:840 - info: [debug] [ADB] Current device property ‘ro.product.model’: Android SDK built for x86
2018-08-08 21:32:00:841 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.product.manufacturer’
2018-08-08 21:32:00:899 - info: [debug] [ADB] Current device property ‘ro.product.manufacturer’: Google
2018-08-08 21:32:00:901 - info: [debug] [ADB] Uninstalling com.aa.mobileCCIv4
2018-08-08 21:32:00:901 - info: [debug] [ADB] Getting install status for com.aa.mobileCCIv4
2018-08-08 21:32:00:901 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages com.aa.mobileCCIv4’
2018-08-08 21:32:01:178 - info: [debug] [ADB] App is not installed
2018-08-08 21:32:01:178 - info: [ADB] com.aa.mobileCCIv4 was not uninstalled, because it was not present on the device
2018-08-08 21:32:01:179 - info: [debug] [ADB] Getting install status for com.aa.mobileCCIv4
2018-08-08 21:32:01:180 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages com.aa.mobileCCIv4’
2018-08-08 21:32:01:446 - info: [debug] [ADB] App is not installed
2018-08-08 21:32:01:446 - info: [debug] [AndroidDriver] Running full reset on ‘com.aa.mobileCCIv4’ (reinstall)
2018-08-08 21:32:01:447 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell getprop ro.build.version.sdk’
2018-08-08 21:32:01:505 - info: [debug] [ADB] Current device property ‘ro.build.version.sdk’: 27
2018-08-08 21:32:01:505 - info: [debug] [ADB] Device API level: 27
2018-08-08 21:32:01:506 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 install -r -g D:\workspaces\ccimobileautomation\src\app-release.apk’
2018-08-08 21:32:04:327 - info: [debug] [ADB] Install command stdout: Success
2018-08-08 21:32:04:328 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell rm -rf /data/local/tmp/strings.json’
2018-08-08 21:32:04:452 - info: [debug] [AndroidDriver] Extracting strings from apk
2018-08-08 21:32:04:452 - info: [debug] [AndroidDriver] D:\workspaces\ccimobileautomation\src\app-release.apk
2018-08-08 21:32:04:452 - info: [debug] [AndroidDriver] null
2018-08-08 21:32:04:452 - info: [debug] [AndroidDriver] C:\Users\892475\AppData\Local\Temp\com.aa.mobileCCIv4
2018-08-08 21:32:04:454 - info: [debug] [ADB] Extracting strings for language: default
2018-08-08 21:32:04:659 - info: [ADB] Successfully extracted 60 strings from ‘D:\workspaces\ccimobileautomation\src\app-release.apk’ resources for ‘(default)’ configuration
2018-08-08 21:32:04:684 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 push C:\Users\892475\AppData\Local\Temp\com.aa.mobileCCIv4\strings.json /data/local/tmp’
2018-08-08 21:32:04:753 - info: [debug] [AndroidBootstrap] Watching for bootstrap disconnect
2018-08-08 21:32:04:754 - info: [debug] [ADB] Forwarding system: 4724 to device: 4724
2018-08-08 21:32:04:755 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 forward tcp:4724 tcp:4724’
2018-08-08 21:32:04:793 - info: [debug] [UiAutomator] Starting UiAutomator
2018-08-08 21:32:04:793 - info: [debug] [UiAutomator] Moving to state ‘starting’
2018-08-08 21:32:04:793 - info: [debug] [UiAutomator] Parsing uiautomator jar
2018-08-08 21:32:04:794 - info: [debug] [UiAutomator] Found jar name: ‘AppiumBootstrap.jar’
2018-08-08 21:32:04:794 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 push C:\Users\892475\AppData\Roaming\npm\node_modules\appium\node_modules\appium-android-bootstrap\bootstrap\bin\AppiumBootstrap.jar /data/local/tmp/’
2018-08-08 21:32:04:846 - info: [debug] [ADB] Attempting to kill all uiautomator processes
2018-08-08 21:32:04:847 - info: [debug] [ADB] Getting all processes with uiautomator
2018-08-08 21:32:04:847 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps’
2018-08-08 21:32:04:927 - info: [ADB] No uiautomator process found to kill, continuing…
2018-08-08 21:32:04:927 - info: [debug] [UiAutomator] Starting UIAutomator
2018-08-08 21:32:04:927 - info: [debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s",“emulator-5554”,“shell”,“uiautomator”,“runtest”,“AppiumBootstrap.jar”,"-c",“io.appium.android.bootstrap.Bootstrap”,"-e",“pkg”,“com.aa.mobileCCIv4”,"-e",“disableAndroidWatchers”,false,"-e",“acceptSslCerts”,false]
2018-08-08 21:32:05:242 - info: [debug] [UiAutomator] Moving to state ‘online’
2018-08-08 21:32:05:244 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
2018-08-08 21:32:05:245 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
2018-08-08 21:32:05:246 - info: [AndroidBootstrap] Android bootstrap socket is now connected
2018-08-08 21:32:05:248 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window’
2018-08-08 21:32:05:271 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
2018-08-08 21:32:05:304 - info: [AndroidDriver] Screen already unlocked, doing nothing
2018-08-08 21:32:05:305 - info: [debug] [ADB] Device API level: 27
2018-08-08 21:32:05:305 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am start -W -n com.aa.mobileCCIv4/com.aa.mobileCCIv4.MainActivity -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000’
2018-08-08 21:32:07:411 - info: [debug] [ADB] Waiting up to 20000ms for activity matching pkg: ‘com.aa.mobileCCIv4’ and activity: ‘com.aa.mobileCCIv4.MainActivity’ to be focused
2018-08-08 21:32:07:412 - info: [debug] [ADB] Possible activities, to be checked: ‘com.aa.mobileCCIv4.MainActivity’, ‘com.aa.mobileCCIv4.com.aa.mobileCCIv4.MainActivity’
2018-08-08 21:32:07:415 - info: [debug] [ADB] Getting focused package and activity
2018-08-08 21:32:07:415 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell dumpsys window windows’
2018-08-08 21:32:07:557 - info: [debug] [ADB] Found package: ‘com.aa.mobileCCIv4’ and fully qualified activity name : ‘com.aa.mobileCCIv4.MainActivity’
2018-08-08 21:32:07:560 - info: [Appium] New AndroidDriver session created successfully, session fc54d99c-e668-4011-899f-7ed31ef9b6fd added to master session list
2018-08-08 21:32:07:561 - info: [debug] [BaseDriver] Event ‘newSessionStarted’ logged at 1533763927561 (16:32:07 GMT-0500 (Central Daylight Time))
2018-08-08 21:32:07:563 - info: [debug] [MJSONWP] Responding to client with driver.createSession() result: {“platform”:“LINUX”,“webStorageEnabled”:false,“takesScreenshot”:true,“javascriptEnabled”:true,“databaseEnabled”:false,“networkConnectionEnabled”:true,“locationContextEnabled”:false,“warnings”:{},“desired”:{“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appPackage”:“com.aa.mobileCCIv4”,“rotatable”:true,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“deviceName”:“Android Emulator”,“fullReset”:true,“avd”:“DEMO”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“newCommandTimeout”:100,“autoGrantPermissions”:true,“takesScreenshot”:true,“platformName”:“Android”},“app”:“D:\workspaces\ccimobileautomation\src\app-release.apk”,“appPackage”:“com.aa.mobileCCIv4”,“rotatable”:true,“appWaitActivity”:“com.aa.mobileCCIv4.MainActivity”,“deviceName”:“emulator-5554”,“fullReset”:true,“avd”:“DEMO”,“appActivity”:“com.aa.mobileCCIv4.MainActivity”,“newCommandTimeout”:100,“autoGrantPermissions”:true,“platformName”:“Android”,“deviceUDID”:“emulator-5554”,“platformVersion”:“8.1.0”,“deviceScreenSize”:“1080x19…
2018-08-08 21:32:07:564 - info: [HTTP] <-- POST /wd/hub/session 200 16383 ms - 1169
2018-08-08 21:32:07:564 - info: [HTTP]
2018-08-08 21:33:14:764 - info: [HTTP] --> POST /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd/element
2018-08-08 21:33:14:764 - info: [HTTP] {“using”:”-android uiautomator",“value”:“new UiSelector().resourceId(“btnLogin”)”}
2018-08-08 21:33:14:766 - info: [debug] [W3C] Calling AppiumDriver.findElement() with args: ["-android uiautomator",“new UiSelector().resourceId(“btnLogin”)”,“fc54d99c-e668-4011-899f-7ed31ef9b6fd”]
2018-08-08 21:33:14:773 - info: [debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
2018-08-08 21:33:14:773 - info: [debug] [BaseDriver] Waiting up to 0 ms for condition
2018-08-08 21:33:14:775 - info: [debug] [AndroidBootstrap] Sending command to android: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UiSelector().resourceId(“btnLogin”)”,“context”:"",“multiple”:false}}
2018-08-08 21:33:14:778 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“action”,“action”:“find”,“params”:{“strategy”:"-android uiautomator",“selector”:“new UiSelector().resourceId(“btnLogin”)”,“context”:"",“multiple”:false}}
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘new UiSelector().resourceId(“btnLogin”)’ using ‘ANDROID_UIAUTOMATOR’ with the contextId: ‘’ multiple: false
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: new UiSelector().resourceId(“btnLogin”)
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] UiSelector coerce type: class java.lang.String arg: “btnLogin”
2018-08-08 21:33:14:779 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=btnLogin]
2018-08-08 21:33:15:583 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Failed to locate element. Clearing Accessibility cache and retrying.
2018-08-08 21:33:15:584 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding ‘new UiSelector().resourceId(“btnLogin”)’ using ‘ANDROID_UIAUTOMATOR’ with the contextId: ‘’ multiple: false
2018-08-08 21:33:15:584 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Parsing selector: new UiSelector().resourceId(“btnLogin”)
2018-08-08 21:33:15:584 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] UiSelector coerce type: class java.lang.String arg: “btnLogin”
2018-08-08 21:33:15:584 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[RESOURCE_ID=btnLogin]
2018-08-08 21:33:20:135 - info: [debug] [AndroidBootstrap] Received command result from bootstrap
2018-08-08 21:33:20:136 - info: [debug] [MJSONWP] Matched JSONWP error code 7 to NoSuchElementError
2018-08-08 21:33:20:182 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:7,“value”:“No element found”}
2018-08-08 21:33:20:184 - info: [HTTP] <-- POST /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd/element 500 5418 ms - 164
2018-08-08 21:33:20:184 - info: [HTTP]
2018-08-08 21:33:20:218 - info: [HTTP] --> GET /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd/screenshot
2018-08-08 21:33:20:218 - info: [HTTP] {}
2018-08-08 21:33:20:220 - info: [debug] [W3C] Calling AppiumDriver.getScreenshot() with args: [“fc54d99c-e668-4011-899f-7ed31ef9b6fd”]
2018-08-08 21:33:20:221 - info: [debug] [ADB] Device API level: 27
2018-08-08 21:33:21:120 - info: [debug] [MJSONWP] Responding to client with driver.getScreenshot() result: "iVBORw0KGgoAAAANSUhEUgAABDgAAAeACAYAAAArYecKAACAAElEQVR4AeTBwctt90Go4ff9ztnJSU/bnNRSapoYJWqCCkkRK9gMAoIgKC3OO/IfEByLEZwKwQ4yrf4FKggiDsxYsMGCoKTQWAdppZCSQNPk5Lz3/gYLFou19157f/s7yb0+j0B8jFQqVCqOUamYqFQcolJxiMpQsY9KxURlUrFGpWKNSsWgUjFRqbg0lYollYpDVCquQ6ViTqXiElQq9lGpmKgMFceoVJxKpWJQqbgulYo5lYp9VCrOoVLxsKhUzKlUXJpKxSWpVByiUjGoVKhUDCpLFUsqFYeoVAwqFUsqFROVii1UKtaoVKxRqTiXylChUrGVSsUxKkPFPioVcyoVg0rFRKXipqlU3CSVCpWKY1QqJioV+6hULKlU7KNScZNUKk6lUnEJKhXnUqm4JJUKlYpDVCq2Uqk4RKXiXCoV51KpuBSVikNUKpZUhorrUBkqzqFSsUalQqViUKlYUqm4DpWKiUrFTVAZKq5LpWKiUvG/hUrFRKXiGJWKiUqFSsVEpUKlYk6lYqJScYxKxZJKxSWoVExUKo5RqdhKpeIcKhWXoFJxzC3gFRZUllTmVJZUJirnUpmoTFQqzqEyUVlSqThGZVCpuGkqSyqDyhYqN0nlEJVzqUxU1qicSuUUKhWDykTlHCr7qAwqcypzKoPKGpVLUjmFypLKpahch8qcyjEqg8qcypzKRGVOZUllorKPypxKxcOmMqcyp7Kkso/KTVDZSmUfla1UDlGpGFQGlUNUVOZUBhWVOZU1KhOVfVSWVCYql6IyUbkUFZU5letQOUZlSWVJ5RQql6Qyp7KVyieRykTlUlQGlYnKISqXpnKMypLKksp1qCypDCpbqAwqW6lMVE6hcpNUBpUllUFFZY3KuVROoTKnonJdKvuoXIfKoLKVSsXDonIOlX1UborKkso+KoPKMSprVC5JZc0t4BUWVCYq51C5DpUtVFQmKtehcgqVJZV9…
2018-08-08 21:33:21:125 - info: [HTTP] <-- GET /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd/screenshot 200 904 ms - 151438
2018-08-08 21:33:21:126 - info: [HTTP]
2018-08-08 21:33:21:689 - info: [HTTP] --> DELETE /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd
2018-08-08 21:33:21:689 - info: [HTTP] {}
2018-08-08 21:33:21:689 - info: [debug] [W3C] Calling AppiumDriver.deleteSession() with args: [“fc54d99c-e668-4011-899f-7ed31ef9b6fd”]
2018-08-08 21:33:21:689 - info: [debug] [BaseDriver] Event ‘quitSessionRequested’ logged at 1533764001689 (16:33:21 GMT-0500 (Central Daylight Time))
2018-08-08 21:33:21:690 - info: [Appium] Removing session fc54d99c-e668-4011-899f-7ed31ef9b6fd from our master session list
2018-08-08 21:33:21:691 - info: [debug] [AndroidDriver] Shutting down Android driver
2018-08-08 21:33:21:693 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.aa.mobileCCIv4’
2018-08-08 21:33:21:883 - info: [debug] [ADB] Pressing the HOME button
2018-08-08 21:33:21:884 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell input keyevent 3’
2018-08-08 21:33:22:819 - info: [debug] [ADB] Uninstalling com.aa.mobileCCIv4
2018-08-08 21:33:22:819 - info: [debug] [ADB] Getting install status for com.aa.mobileCCIv4
2018-08-08 21:33:22:819 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell pm list packages com.aa.mobileCCIv4’
2018-08-08 21:33:23:277 - info: [debug] [ADB] App is installed
2018-08-08 21:33:23:277 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop com.aa.mobileCCIv4’
2018-08-08 21:33:23:347 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 uninstall com.aa.mobileCCIv4’
2018-08-08 21:33:23:611 - info: [debug] [ADB] ‘adb uninstall com.aa.mobileCCIv4’ command output: Success
2018-08-08 21:33:23:611 - info: [ADB] com.aa.mobileCCIv4 was successfully uninstalled
2018-08-08 21:33:23:612 - info: [debug] [AndroidBootstrap] Sending command to android: {“cmd”:“shutdown”}
2018-08-08 21:33:23:618 - info: [debug] [AndroidBootstrap] Received command result from bootstrap
2018-08-08 21:33:23:618 - info: [debug] [UiAutomator] Shutting down UiAutomator
2018-08-08 21:33:23:619 - info: [debug] [UiAutomator] Moving to state ‘stopping’
2018-08-08 21:33:23:623 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {“cmd”:“shutdown”}
2018-08-08 21:33:23:623 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
2018-08-08 21:33:23:623 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {“status”:0,“value”:“OK, shutting down”}
2018-08-08 21:33:23:623 - info: [debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
2018-08-08 21:33:23:623 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: current=1

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: 0

2018-08-08 21:33:23:624 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=

2018-08-08 21:33:23:625 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] Test results for WatcherResultPrinter=.

2018-08-08 21:33:23:625 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] Time: 78.381

2018-08-08 21:33:23:625 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] OK (1 test)

2018-08-08 21:33:23:625 - info: [debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS_CODE: -1

2018-08-08 21:33:23:650 - info: [debug] [UiAutomator] UiAutomator shut down normally
2018-08-08 21:33:23:650 - info: [debug] [UiAutomator] Moving to state ‘stopped’
2018-08-08 21:33:23:650 - info: [debug] [ADB] Attempting to kill all uiautomator processes
2018-08-08 21:33:23:651 - info: [debug] [ADB] Getting all processes with uiautomator
2018-08-08 21:33:23:651 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell ps’
2018-08-08 21:33:23:839 - info: [ADB] No uiautomator process found to kill, continuing…
2018-08-08 21:33:23:839 - info: [debug] [UiAutomator] Moving to state ‘stopped’
2018-08-08 21:33:23:840 - info: [debug] [Logcat] Stopping logcat capture
2018-08-08 21:33:23:844 - info: [debug] [ADB] Running ‘C:\Users\892475\AppData\Local\Android\Sdk\platform-tools\adb.exe -P 5037 -s emulator-5554 shell am force-stop io.appium.unlock’
2018-08-08 21:33:23:954 - info: [debug] [AndroidDriver] Not cleaning generated files. Add clearSystemFiles capability if wanted.
2018-08-08 21:33:23:954 - info: [debug] [BaseDriver] Event ‘quitSessionFinished’ logged at 1533764003954 (16:33:23 GMT-0500 (Central Daylight Time))
2018-08-08 21:33:23:955 - info: [debug] [MJSONWP] Received response: null
2018-08-08 21:33:23:955 - info: [debug] [MJSONWP] But deleting session, so not returning
2018-08-08 21:33:23:955 - info: [debug] [MJSONWP] Responding to client with driver.deleteSession() result: null
2018-08-08 21:33:23:956 - info: [HTTP] <-- DELETE /wd/hub/session/fc54d99c-e668-4011-899f-7ed31ef9b6fd 200 2267 ms - 76
2018-08-08 21:33:23:956 - info: [HTTP]

Appium configuration:

File srcFile = new File(“src”);
File apkFile = new File(srcFile,“app.apk”);
DesiredCapabilities cap=new DesiredCapabilities();
if(isVirtualDevice){
cap.setCapability(“deviceName”,“Android Emulator”);
cap.setCapability(“avd”,“DEMO”);
}else{
cap.setCapability(MobileCapabilityType.DEVICE_NAME, “Android”);
}
cap.setCapability(MobileCapabilityType.PLATFORM_NAME,MobilePlatform.ANDROID);
cap.setCapability(“platformName”,“Android”);
cap.setCapability(“appPackage”,“com.moble”);
cap.setCapability(“appActivity”,“com.mobile”);
cap.setCapability(“appWaitActivity”,“com.mobile”);
cap.setCapability(“autoGrantPermissions”, “true”);
cap.setCapability(“rotatable”, true);
cap.setCapability(“takesScreenshot”, true);
cap.setCapability(“fullReset”,true);
cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, “100”);
cap.setCapability(MobileCapabilityType.APP, apkFile.getAbsolutePath());
AndroidDriver driver =new AndroidDriver(new URL(“http://127.0.0.1:4723/wd/hub”),cap );
return driver;

Please help me.


#2

Hey, any idea on whats going wrong ?


#3

Install Appium Desktop version and try to see if you can locate the element. Is it working for iOS emulators? What version of Android do you have? For Android >5.0 you can use UIAutomator2 for finding elements. I had a similar issue for Android 8.0


#4

Hi Laris,

Thanks for replying,. Today morning i could able to locate the element when i open the app manually in the mobile. When the app is open automatically no element is identified. I am surprised , whats happening. I will try with Appium desktop version once.