无法通过appium-RobotFramework

时间:2019-02-12 13:25:29

标签: android-emulator robotframework appium-android

想通过appium-robotframework运行本机应用程序。但是appium无法连接到模拟器

已安装appium Windows安装程序,Ride,Nodejs。安装了“ pip install robotframework-appiumlibrary”。增加了通向环境的途径。编写脚本: *设置* 图书馆AppiumLibrary

*测试用例* 交货     [标签] run1     打开应用程序http://localhost:4723/wd/hub platformName = Android platformVersion = 8.0.0 deviceName = emulator-5554 appPackage = com.android.Calculator appActivity = com.android.Calculator     睡眠5秒

点击在Ride中运行并启动appium节点服务器

  

使用以下命令启动Appium服务器:C:\ Program Files(x86)\ Appium \ node.exe lib \ server \ main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-版本23 --automation-name Appium --log-no-color   信息:欢迎使用Appium v​​1.4.16(REV ae6877eff263066b26328d457bd285c0cc62430d)   信息:Appium REST HTTP接口监听器始于127.0.0.1:4723   信息:[调试]非默认服务器参数:{“地址”:“ 127.0.0.1”,“ logNoColors”:true,“ platformName”:“ Android”,“ platformVersion”:“ 23”,“ automationName”:“ Appium “}   信息:控制台LogLevel:调试   信息:-> POST / wd / hub / session {“ capabilities”:{“ firstMatch”:[{“ appium:deviceName”:“ emulator-5554”,“ appium:appActivity”:“ com.android.Calculator”, “ platformName”:“ Android”,“ appium:appPackage”:“ com.android.Calculator”,“ appium:platformVersion”:“ 8.0.0”}]},“ desiredCapabilities”:{“ platformVersion”:“ 8.0.0 “,” deviceName“:” emulator-5554“,” platformName“:” Android“,” appActivity“:” com.android.Calculator“,” appPackage“:” com.android.Calculator“}}   信息:客户端用户代理字符串:selenium / 3.141.0(python Windows)   信息:[调试]未获取应用程序但获取了Android程序包,将尝试在设备上启动它   信息:[调试]创建新的appium会话76d74fa1-d43f-4060-b2a8-df3abbf9b60b   信息:启动android appium   信息:[调试]获取Java版本   信息:Java版本是:1.8.0_201   信息:[调试]检查adb是否存在   信息:[调试]从C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe使用adb   警告:没有应用功能,无法解析包/活动   信息:[调试]使用快速重置?真正   信息:[调试]准备会话的设备   信息:[调试]由于我们假设应用程序已经在设备上,因此不检查是否存在该应用程序   信息:检索设备   信息:[调试]试图找到连接的android设备   信息:[调试]正在连接设备...   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe设备   信息:[调试]已连接1台设备   信息:找到设备模拟器-5554   信息:[调试]将设备ID设置为模拟器-5554   信息:[调试]等待设备准备就绪并响应外壳命令(超时= 5)   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554等待设备   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554 shell“ echo'ready'”   信息:[调试]开始捕获logcat   信息:[调试]获取设备API级别   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554 shell“ getprop ro.build.version.sdk”   信息:[调试]设备处于API级别26   信息:设备API级别为:26   信息:[调试]提取语言字符串:默认   信息:[调试] Apk在本地不存在   信息:[调试]无法获取字符串,但无论如何我们似乎都拥有一个旧的字符串文件,因此可以忽略   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554 shell“ rm -rf / data / local / tmp / strings .json”   信息:[调试]由于服务器未以--full-reset启动,因此未卸载应用程序   信息:[调试]由于我们使用软件包而不是应用程序路径启动,因此跳过安装   信息:[调试]转发系统:4724到设备:4724   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554转发tcp:4724 tcp:4724   信息:[调试]将appium引导程序推入设备...   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554推送“ C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ android_bootstrap \ AppiumBootstrap.jar“ / data / local / tmp /   信息:[调试]将设置apk推送到设备...   信息:[调试]执行cmd:C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554安装“ C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk“   信息:[调试]停止logcat捕获   信息:[调试] Logcat终止,代码为空,信号SIGTERM   信息:[调试]发送关闭命令,等待UiAutomator停止...   警告:UiAutomator没有足够快地关闭,称其消失了   信息:[调试]清理android对象   错误:无法启动Appium会话,错误是:错误:命令失败:C:\ windows \ system32 \ cmd.exe / s / c“ C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform -tools \ adb.exe -s emulator-5554安装“ C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk”   adb:安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试重新安装io.appium.settings而不先卸载。   信息:[调试]清理appium会话   信息:[调试]错误:命令失败:C:\ windows \ system32 \ cmd.exe / s / c“ C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe- s emulator-5554安装“ C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk”   adb:无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试重新安装io.appium.settings而不先卸载。] < / p>

at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1016:16)
at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
     

信息:[调试]响应错误,客户端:{“状态”:33,“值”:{“消息”:“无法创建新会话。(原始错误:命令失败:C:\ windows \ system32 \ cmd.exe / s / c \“ C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554 install \” C:\ Program Files( x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \“ \” \ nadb:无法安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug .apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试不先卸载就重新安装io.appium.settings。] \ r \ n)“,” killed“:false,” code“:1,” signal“:null,” cmd“ :“” C:\ windows \ system32 \ cmd.exe / s / c \“ C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ Sdk \ platform-tools \ adb.exe -s emulator-5554 install \” C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \“ \”“,” origValue“:”命令失败:C:\ windows \ system32 \ cmd.exe / s / c \“ C:\ Users \ avishek.dhar \ AppData \ Local \ Android \ sdk \ platform-tools \ adb.exe -s emulator-5554 install \“ C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk \” \“ \ nadb:失败安装C:\ Program Files(x86)\ Appium \ node_modules \ appium \ build \ settings_apk \ settings_apk-debug.apk:失败[INSTALL_FAILED_ALREADY_EXISTS:尝试不首先卸载就重新安装io.appium.settings。] \ r \ n“ },“ sessionId”:null}   信息:<-POST / wd / hub / session 500 8018.813 ms-1418

预计我应该能够在android仿真器中启动计算器以编写更多的测试脚本

1 个答案:

答案 0 :(得分:0)

您的设置失败,原因是:

Failure [INSTALL_FAILED_ALREADY_EXISTS: Attempt to re-install io.appium.settings without first uninstalling.]

修改您的设置,特别是以下内容:

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