如果设置了required_caps ['automationName'] ='uiautomator2',则Appium启动失败

时间:2018-11-22 08:51:22

标签: python appium

当我尝试启动appium时,如果我设置desired_caps['automationName'] = 'uiautomator2',则会收到以下错误消息,但如果未设置,则appium可以正常运行。现在,我需要设置此设置,以在应用程序自动化测试中验证吐司消息。那么,如果有人可以帮助您呢?谢谢

appium版本:1.8.2

appium setting:
        desired_caps = {}
        desired_caps['platformName'] = 'Android'
        desired_caps['platformVersion'] = '7.0'
        desired_caps['deviceName'] = 'ZY223STC2M'
        desired_caps['automationName'] = 'uiautomator2'
        # desired_caps['app'] = PATH("../../app/build/outputs/apk/app-debug.apk")
        desired_caps['appPackage'] = 'com.test.sdk.demo'
        desired_caps['appActivity'] = '.HomeActivity'
        self.driver = webdriver.Remote('http://localhost:4723/wd/hub', desired_caps)

错误消息:

[MJSONWP] Encountered internal error running command: Error: Error executing adbExec. Original error: 'Command '/Users/huangjincheng/Library/Android/sdk/platform-tools/adb -P 5037 -s ZY223STC2M pull /data/app/com.test.sdk.demo-2/base.apk /var/folders/lk/lc_q_c9s6hjb06_fv57w290c0000gn/T/com.test.sdk.demo.apk' exited with code 1'; Stderr: ''; Code: '1'
[MJSONWP]     at ADB.execFunc$ (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/appium-adb/lib/tools/system-calls.js:327:13)
[MJSONWP]     at tryCatch (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:67:40)
[MJSONWP]     at GeneratorFunctionPrototype.invoke [as _invoke] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:315:22)
[MJSONWP]     at GeneratorFunctionPrototype.prototype.(anonymous function) [as throw] (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:100:21)
[MJSONWP]     at GeneratorFunctionPrototype.invoke (/Applications/Appium.app/Contents/Resources/app/node_modules/appium/node_modules/babel-runtime/regenerator/runtime.js:136:37)
[MJSONWP]     at run (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:75:1)
[MJSONWP]     at /Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/es6.promise.js:92:1
[MJSONWP]     at flush (/Applications/Appium.app/Contents/Resources/app/webpack:/~/babel-polyfill/~/core-js/modules/_microtask.js:18:1)
[MJSONWP]     at process._tickCallback (internal/process/next_tick.js:61:11)
[HTTP] <-- POST /wd/hub/session 500 14391 ms - 438
[HTTP] 

0 个答案:

没有答案