Skip to content

Instantly share code, notes, and snippets.

@dpgraham
Created March 17, 2017 16:46
Show Gist options
  • Save dpgraham/0f9cb1b7a30ab1900cd4cd8dd85d1492 to your computer and use it in GitHub Desktop.
Save dpgraham/0f9cb1b7a30ab1900cd4cd8dd85d1492 to your computer and use it in GitHub Desktop.
Attach Session Error
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"appPackage":"com.package.tc","app":"/Users/Mithun/Documents/workspace/test.apk","noReset":true,"version":"","deviceName":"My Device","fullReset":false,"platform":"ANDROID","appActivity":"com.testlogin.controller.LoginActivity","newCommandTimeout":30000,"automationName":"appium","browserName":"android","platformName":"Android"}}
[debug] [MJSONWP] Calling AppiumDriver.createSession() with args: [{"appPackage":"com.package.tc","app":"/Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk","noReset":true,"version":"","deviceName":"Mi Device","fullReset":false,"platform":"ANDROID","appActivity":"com.package.tc.login.controller.LoginActivity","newCommandTimeout":30000,"automationName":"appium","browserName":"android","platformName":"Android"},null,null,null,null]
[debug] [BaseDriver] Event 'newSessionRequested' logged at 1489764246711 (20:54:06 GMT+0530 (IST))
[Appium] Creating new AndroidDriver (v1.13.0) session
[Appium] Capabilities:
[Appium] appPackage: 'com.package.tc'
[Appium] app: '/Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk'
[Appium] noReset: true
[Appium] version: ''
[Appium] deviceName: 'Mi Device'
[Appium] fullReset: false
[Appium] platform: 'ANDROID'
[Appium] appActivity: 'com.package.tc.login.controller.LoginActivity'
[Appium] newCommandTimeout: 30000
[Appium] automationName: 'appium'
[Appium] browserName: 'android'
[Appium] platformName: 'Android'
[Appium] Session override is on. Deleting other sessions.
[Appium] Deleting session 'da747dba-014a-451a-b949-8a1912889af5'
[debug] [AndroidDriver] Shutting down Android driver
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","am","force-stop","com.package.tc"]
[debug] [ADB] Pressing the HOME button
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","input","keyevent",3]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"shutdown"}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type SHUTDOWN
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [UiAutomator] Shutting down UiAutomator
[debug] [UiAutomator] Moving to state 'stopping'
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Closed client connection
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: numtests=1
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: stream=.
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
[debug] [AndroidBootstrap] [UIAUTO STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
[debug] [UiAutomator] UiAutomator shut down normally
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[debug] [UiAutomator] Moving to state 'stopped'
[debug] [Logcat] Stopping logcat capture
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","am","force-stop","io.appium.unlock"]
[debug] [AndroidDriver] Not cleaning generated files. Add `clearSystemFiles` capability if wanted.
[Appium] Removing session da747dba-014a-451a-b949-8a1912889af5 from our master session list
[debug] [AndroidDriver] AndroidDriver version: 1.13.0
[BaseDriver] The following capabilities were provided, but are not recognized by appium: version, platform.
[AndroidDriver] The desired capabilities should generally not include both an app and a browserName
[BaseDriver] Session created with session id: f42ecb66-7065-46a6-878c-e74ed60c5c74
[debug] [AndroidDriver] Getting Java version
[AndroidDriver] Java version is: 1.8.0_60
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/Mithun/Library/Android/sdk/platform-tools/adb
[AndroidDriver] Retrieving device list
[debug] [ADB] Trying to find a connected android device
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[AndroidDriver] Using device: 11accc70
[ADB] Checking whether adb is present
[ADB] Using adb from /Users/Mithun/Library/Android/sdk/platform-tools/adb
[debug] [ADB] Setting device id to 11accc70
[BaseDriver] Using local app '/Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk'
[debug] [AndroidDriver] Checking whether app is actually present
[AndroidDriver] Starting Android session
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","wait-for-device"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","echo","ping"]
[debug] [Logcat] Starting logcat capture
[debug] [AndroidDriver] Pushing settings apk to device...
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","install","/usr/local/lib/node_modules/appium/node_modules/io.appium.settings/bin/settings_apk-debug.apk"]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [AndroidDriver] Pushing unlock helper app to device...
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","install","/usr/local/lib/node_modules/appium/node_modules/appium-unlock/bin/unlock_apk-debug.apk"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","ro.build.version.sdk"]
[debug] [ADB] Device API level: 21
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","settings","put","secure","mock_location","1"]
[ADB] Getting device platform version
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","ro.build.version.release"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","wm","size"]
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","ro.product.model"]
[debug] [ADB] Current device property 'ro.product.model': Mi 4i
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","ro.product.manufacturer"]
[debug] [ADB] Current device property 'ro.product.manufacturer': Xiaomi
[AndroidDriver] Remote apk path is /data/local/tmp/0b41e8d81ec4a2f6e0e95e75acaf2c8f.apk
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","ls","/data/local/tmp/0b41e8d81ec4a2f6e0e95e75acaf2c8f.apk"]
[debug] [AndroidDriver] Checking if app is installed
[debug] [ADB] Getting install status for com.package.tc
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","pm","list","packages","com.package.tc"]
[debug] [ADB] App is installed
[debug] [AndroidDriver] Extracting strings from apk /Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk null /var/folders/0m/276djlyd0rddnv5ht20w65b40000gn/T/com.package.tc
[debug] [ADB] Extracting strings for language: default
[debug] [ADB] Device API level: 21
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","persist.sys.language"]
[debug] [ADB] Current device property 'persist.sys.language': en
[debug] [ADB] No strings.xml for language 'en', getting default strings.xml
[debug] [ADB] Reading strings from converted strings.json
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","push","/var/folders/0m/276djlyd0rddnv5ht20w65b40000gn/T/com.package.tc/strings.json","/data/local/tmp"]
[debug] [AndroidBootstrap] Watching for bootstrap disconnect
[debug] [ADB] Forwarding system: 4724 to device: 4724
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","forward","tcp:4724","tcp:4724"]
[debug] [UiAutomator] Starting UiAutomator
[debug] [UiAutomator] Moving to state 'starting'
[debug] [UiAutomator] Parsing uiautomator jar
[debug] [UiAutomator] Found jar name: 'AppiumBootstrap.jar'
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","push","/usr/local/lib/node_modules/appium/node_modules/appium-android-bootstrap/bootstrap/bin/AppiumBootstrap.jar","/data/local/tmp/"]
[debug] [ADB] Attempting to kill all uiautomator processes
[debug] [ADB] Getting all processes with uiautomator
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","ps"]
[ADB] No uiautomator process found to kill, continuing...
[debug] [UiAutomator] Starting UIAutomator
[debug] [ADB] Creating ADB subprocess with args: ["-P",5037,"-s","11accc70","shell","uiautomator","runtest","AppiumBootstrap.jar","-c","io.appium.android.bootstrap.Bootstrap","-e","pkg","com.package.tc","-e","disableAndroidWatchers",false,"-e","acceptSslCerts",false]
[debug] [UiAutomator] Moving to state 'online'
[AndroidBootstrap] Android bootstrap socket is now connected
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","dumpsys","window"]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] json loading complete.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Registered crash watchers.
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Client connected
[AndroidDriver] Screen already unlocked, doing nothing
[debug] [ADB] Device API level: 21
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","am","start","-W","-n","com.package.tc/com.package.tc.login.controller.LoginActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[Appium] New AndroidDriver session created successfully, session f42ecb66-7065-46a6-878c-e74ed60c5c74 added to master session list
[debug] [BaseDriver] Event 'newSessionStarted' logged at 1489764259599 (20:54:19 GMT+0530 (IST))
[debug] [MJSONWP] Responding to client with driver.createSession() result: {"platform":"ANDROID","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"appPackage":"com.package.tc","app":"/Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk","noReset":true,"version":"","deviceName":"Mi Device","fullReset":false,"platform":"ANDROID","appActivity":"com.package.tc.login.controller.LoginActivity","newCommandTimeout":30000,"automationName":"appium","browserName":"android","platformName":"Android"},"appPackage":"com.package.tc","app":"/Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk","noReset":true,"version":"","deviceName":"11accc70","fullReset":false,"appActivity":"com.package.tc.login.controller.LoginActivity","newCommandTimeout":30000,"automationName":"appium","browserName":"android","platformName":"Android","deviceUDID":"11accc70","platfor...
[HTTP] <-- POST /wd/hub/session 200 12890 ms - 1194
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.4-beta","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 9527 ms - 88
[HTTP] --> POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/appium/app/launch {}
[debug] [MJSONWP] Calling AppiumDriver.launchApp() with args: ["f42ecb66-7065-46a6-878c-e74ed60c5c74"]
[AndroidDriver] Remote apk path is /data/local/tmp/0b41e8d81ec4a2f6e0e95e75acaf2c8f.apk
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","ls","/data/local/tmp/0b41e8d81ec4a2f6e0e95e75acaf2c8f.apk"]
[debug] [AndroidDriver] Checking if app is installed
[debug] [ADB] Getting install status for com.package.tc
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","pm","list","packages","com.package.tc"]
[debug] [ADB] App is installed
[debug] [AndroidDriver] Extracting strings from apk /Users/Mithun/Documents/workspace/TCAutomation_Android/apps/test.apk null /var/folders/0m/276djlyd0rddnv5ht20w65b40000gn/T/com.package.tc
[debug] [ADB] Extracting strings for language: default
[debug] [ADB] Device API level: 21
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","getprop","persist.sys.language"]
[debug] [ADB] Current device property 'persist.sys.language': en
[debug] [ADB] No strings.xml for language 'en', getting default strings.xml
[debug] [ADB] Reading strings from converted strings.json
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","push","/var/folders/0m/276djlyd0rddnv5ht20w65b40000gn/T/com.package.tc/strings.json","/data/local/tmp"]
[debug] [ADB] Device API level: 21
[debug] [ADB] Getting connected devices...
[debug] [ADB] 1 device(s) connected
[debug] [ADB] Running '/Users/Mithun/Library/Android/sdk/platform-tools/adb' with args: ["-P",5037,"-s","11accc70","shell","am","start","-W","-n","com.package.tc/com.package.tc.login.controller.LoginActivity","-S","-a","android.intent.action.MAIN","-c","android.intent.category.LAUNCHER","-f","0x10200000"]
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.4-beta","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 9 ms - 88
[debug] [MJSONWP] Responding to client with driver.launchApp() result: null
[HTTP] <-- POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/appium/app/launch 200 6472 ms - 76
[HTTP] --> POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/element {"using":"id","value":"edit_txt_username"}
[debug] [MJSONWP] Calling AppiumDriver.findElement() with args: ["id","edit_txt_username","f42ecb66-7065-46a6-878c-e74ed60c5c74"]
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Valid locator strategies for this request: xpath, id, class name, accessibility id, -android uiautomator
[debug] [BaseDriver] Waiting up to 0 ms for condition
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"edit_txt_username","context":"","multiple":false}}
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"id","selector":"edit_txt_username","context":"","multiple":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: find
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.4-beta","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 8 ms - 88
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Finding 'edit_txt_username' using 'ID' with the contextId: '' multiple: false
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using: UiSelector[INSTANCE=0, RESOURCE_ID=com.package.tc:id/edit_txt_username]
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":0,"value":{"ELEMENT":"1"}}
[debug] [AndroidBootstrap] Received command result from bootstrap
[debug] [MJSONWP] Responding to client with driver.findElement() result: {"ELEMENT":"1"}
[HTTP] <-- POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/element 200 150 ms - 87
[HTTP] --> POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/element/1/value {"id":"1","value":["singlelocationl5100"]}
[debug] [MJSONWP] Calling AppiumDriver.setValue() with args: [["singlelocationl5100"],"1","f42ecb66-7065-46a6-878c-e74ed60c5c74"]
[debug] [AndroidBootstrap] Sending command to android: {"cmd":"action","action":"element:setText","params":{"elementId":"1","text":"singlelocationl5100","replace":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got data from client: {"cmd":"action","action":"element:setText","params":{"elementId":"1","text":"singlelocationl5100","replace":false}}
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command of type ACTION
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Got command action: setText
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Using element passed in: 1
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Attempting to clear using UiObject.clearText().
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Sending plain text to element: singlelocationl5100
[AndroidBootstrap] [BOOTSTRAP LOG] [debug] Returning result: {"status":13,"value":"Unknown error"}
[debug] [AndroidBootstrap] Received command result from bootstrap
[HTTP] <-- POST /wd/hub/session/f42ecb66-7065-46a6-878c-e74ed60c5c74/element/1/value 500 309 ms - 154
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
[debug] [MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.4-beta","revision":null}}
[HTTP] <-- GET /wd/hub/status 200 10 ms - 88
[HTTP] --> GET /wd/hub/status {}
[debug] [MJSONWP] Calling AppiumDriver.getStatus() with args: []
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment