问题描述
我对Appium真的很陌生,所以如果有重复的问题请原谅.但是,我尝试使用Appium在Android 5.1.1上的计算器应用程序上运行一些测试,这会导致以下错误.
I'm really new to Appium so excuse me if its a repeat question. But, I'm trying to run some tests on the calculator app on Android 5.1.1 using Appium and it results in the following error.
信息:[调试]错误:用于启动应用程序的活动不存在或 无法启动!确保它存在并且是可启动的活动
info: [debug] Error: Activity used to start app doesn't exist or cannot be launched! Make sure it exists and is a launchable activity
测试代码(功能):
capabilities.setCapability("appPackage", "SecCalculator2");
capabilities.setCapability("appActivity", "com.sec.android.app.popupcalculator.Calculator");
我已经在手机上下载了"APK信息"应用,该应用显示了以下信息.
I have downloaded the 'APK info' app on my phone and this app shows the following info.
APK路径:/system/app/SecCalculator2/SecCalculator2.apk
活动:com.sec.android.app.popupcalculator.Calculator
那么我在功能中使用了正确的程序包和活动名称吗?
So am I using the correct package and activity names in the capabilities?
预先感谢
推荐答案
您应使用以下所需功能添加应用程序文件名:
You should add app file name in desired capabilities like below:
capabilities.setCapability("app", "/system/app/SecCalculator2/SecCalculator2.apk");
您还可以跳过添加"appPackage"和"appActivity" Appium自动启动apk文件中提到的应用程序.
Also you can skip to add "appPackage" and "appActivity" Appium automatically launch application which is mentioned in apk file.
希望这会对您有所帮助.
Hope this will help you.
这篇关于用于启动应用程序的活动不存在(无法在Android 5.1.1中打开计算器应用程序)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!