Appium 运行程序闪退,log 错误为 ERROR - 'super' object has no attribute '__getattr__'

Ambers · 2017年02月28日 · 最后由 Ambers 回复于 2017年03月01日 · 2113 次阅读

日志打印:
C:\python35\python.exe C:/python35/testApp01/testSet/run.py
info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
info: Appium REST http interface listener started on 0.0.0.0:4723
info: Console LogLevel: debug
info: --> GET /wd/hub/status {}
info: [debug] Responding to client with success: {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: <-- GET /wd/hub/status 200 10.979 ms - 105 {"status":0,"value":{"build":{"version":"1.4.16","revision":"ae6877eff263066b26328d457bd285c0cc62430d"}}}
info: --> POST /wd/hub/session {"desiredCapabilities":{"platformName":"Android","resetKeyboard":"True","appPackage":"com.vbill.shoushua.biz","deviceName":"69T7N16705002428","platformVersion":"5.1.1\n\n","unicodeKeyboard":"True","appActivity":"com.vbill.shoushua.ui.activity.LoginActivity"},"requiredCapabilities":{}}
info: Client User-Agent string: Python-urllib/3.5
warn: Converting cap resetKeyboard from string to boolean. This might cause unexpected behavior.
warn: Converting cap unicodeKeyboard from string to boolean. This might cause unexpected behavior.
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 8026ed63-a953-496e-92de-81bb1b17a560
info: Starting android appium
info: [debug] Getting Java version
info: Java version is: 1.8.0_111
info: [debug] Checking whether adb is present
info: [debug] Using adb from D:\adt-bundle-windows-x86_64-20140702\sdk\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: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe devices
info: [debug] 1 device(s) connected
info: Found device 69T7N16705002428
info: [debug] Setting device id to 69T7N16705002428
info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 wait-for-device
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "echo 'ready'"
info: [debug] Starting logcat capture
info: [debug] Getting device API level
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 22
info: Device API level is: 22
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: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 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: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 forward tcp:4724 tcp:4724
info: [debug] Pushing appium bootstrap to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 push "C:\Program Files (x86)\Appium\node_modules\appium\build\android_bootstrap\AppiumBootstrap.jar" /data/local/tmp/
info: [debug] Enabling Unicode keyboard support
info: [debug] Pushing unicode ime to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unicode_ime_apk\UnicodeIME-debug.apk"
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "settings get secure default_input_method"
info: [debug] Unsetting IME 'com.baidu.input_huawei/.ImeService'
info: [debug] Setting IME to 'io.appium.android.ime/.UnicodeIME'
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "ime enable io.appium.android.ime/.UnicodeIME"
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "ime set io.appium.android.ime/.UnicodeIME"
info: [debug] Pushing settings apk to device...
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 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: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 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: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "ps 'uiautomator'"
info: [debug] No matching processes found
info: [debug] Running bootstrap
info: [debug] spawning: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.vbill.shoushua.biz -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: {"status":0,"value":true}
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 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] dataDir set to: /data/local/tmp
info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
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: {"status":0,"value":false}
info: [debug] Getting device API level
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "getprop ro.build.version.sdk"
info: [debug] Device is at API Level 22
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.vbill.shoushua.biz/com.vbill.shoushua.ui.activity.LoginActivity"
info: [debug] Waiting for pkg "com.vbill.shoushua.biz" and activity "com.vbill.shoushua.ui.activity.LoginActivity" to be focused
info: [debug] Getting focused package and activity
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "dumpsys window windows"
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "getprop ro.build.version.release"
info: [debug] Device is at release version 5.1.1
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 8026ed63-a953-496e-92de-81bb1b17a560
info: <-- POST /wd/hub/session 303 13342.547 ms - 74
info: --> GET /wd/hub/session/8026ed63-a953-496e-92de-81bb1b17a560 {}
info: [debug] Responding to client with success: {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"5.1.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","resetKeyboard":true,"appPackage":"com.vbill.shoushua.biz","deviceName":"69T7N16705002428","platformVersion":"5.1.1\n\n","unicodeKeyboard":true,"appActivity":"com.vbill.shoushua.ui.activity.LoginActivity"},"platformName":"Android","resetKeyboard":true,"appPackage":"com.vbill.shoushua.biz","deviceName":"69T7N16705002428","unicodeKeyboard":true,"appActivity":"com.vbill.shoushua.ui.activity.LoginActivity"},"sessionId":"8026ed63-a953-496e-92de-81bb1b17a560"}
info: <-- GET /wd/hub/session/8026ed63-a953-496e-92de-81bb1b17a560 200 3.312 ms - 759 {"status":0,"value":{"platform":"LINUX","browserName":"Android","platformVersion":"5.1.1","webStorageEnabled":false,"takesScreenshot":true,"javascriptEnabled":true,"databaseEnabled":false,"networkConnectionEnabled":true,"locationContextEnabled":false,"warnings":{},"desired":{"platformName":"Android","resetKeyboard":true,"appPackage":"com.vbill.shoushua.biz","deviceName":"69T7N16705002428","platformVersion":"5.1.1\n\n","unicodeKeyboard":true,"appActivity":"com.vbill.shoushua.ui.activity.LoginActivity"},"platformName":"Android","resetKeyboard":true,"appPackage":"com.vbill.shoushua.biz","deviceName":"69T7N16705002428","unicodeKeyboard":true,"appActivity":"com.vbill.shoushua.ui.activity.LoginActivity"},"sessionId":"8026ed63-a953-496e-92de-81bb1b17a560"}
info: --> DELETE /wd/hub/session/8026ed63-a953-496e-92de-81bb1b17a560 {}
info: Shutting down appium session
info: [debug] Pressing the HOME button
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "input keyevent 3"
info: [debug] Resetting IME to 'com.baidu.input_huawei/.ImeService'
info: [debug] executing cmd: D:\adt-bundle-windows-x86_64-20140702\sdk\platform-tools\adb.exe -s 69T7N16705002428 shell "ime set com.baidu.input_huawei/.ImeService"
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: {"status":0,"value":"OK, shutting down"}
info: [debug] [UIAUTOMATOR STDOUT] [CDS] close[4724]
info: [debug] [UIAUTOMATOR STDOUT] close [socket][/0.0.0.0:4724]
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: 3.338
info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
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":"8026ed63-a953-496e-92de-81bb1b17a560"}
info: <-- DELETE /wd/hub/session/8026ed63-a953-496e-92de-81bb1b17a560 200 1529.495 ms - 76 {"status":0,"value":null,"sessionId":"8026ed63-a953-496e-92de-81bb1b17a560"}
E
Process finished with exit code 0
哪位大神,也遇到过这个问题,能帮忙解决一下吗?跪求!!!

共收到 1 条回复 时间 点赞

是我解释的不够清晰吗?
log 打印:2017-02-28 17:50:24,656 - root - INFO - Begin to start Appium Server
2017-02-28 17:50:29,787 - root - INFO - End to start Appium Server
2017-02-28 17:50:29,787 - root - INFO - Open Driver
2017-02-28 17:50:46,422 - root - INFO - Start to test
2017-02-28 17:50:46,432 - root - ERROR - 'super' object has no attribute 'getattr'
2017-02-28 17:50:46,432 - root - INFO - Close to Driver
2017-02-28 17:50:48,127 - root - INFO - Begin stop Appium Server
2017-02-28 17:50:48,167 - root - INFO - End stop Appium Server
困扰我几天了

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