[英]What has to be set in DesiredCapabilites to run Applications app?
On the Android platform there is a menu which shows all installed applications. 在Android平台上,有一个菜单显示所有已安装的应用程序。 My goal is to test this menu using Appium and Java language.
我的目标是使用Appium和Java语言测试此菜单。
As you can see in the attached image the package for this application is com.lge.launcher2 so the "appPackage" variable is known. 正如您在附加图像中看到的,此应用程序的包是com.lge.launcher2,因此“appPackage”变量是已知的。
The problem is that I have to set proper DesiredCapabilities for "appActivity" as well and I have no idea where I can find this name. 问题是我必须为“appActivity”设置适当的DesiredCapabilities,我不知道在哪里可以找到这个名字。 Using adb shell I have grabbed all installed applications and there is "package:/system/priv-app/LGHome.apk=com.lge.launcher2" but when I set my DesiredCapabilities like this:
使用adb shell,我已经获取了所有已安装的应用程序,并且有“ package:/system/priv-app/LGHome.apk=com.lge.launcher2”,但是当我这样设置DesiredCapabilities时:
DesiredCapabilities caps = new DesiredCapabilities();
caps.setCapability("deviceName", "Android");
caps.setCapability("platformName", "Android");
caps.setCapability("appPackage", "com.lge.launcher2");
caps.setCapability("appActivity", "com.lge.launcher2.LGHome");
i got an error that "Activity used to start app doesn't exist or cannot be launched!". 我收到一个错误,“用于启动应用程序的活动不存在或无法启动!”。
So how I can run this Application Menu? 那么我如何运行这个应用程序菜单? Thanks a lot in advance for any hints!
非常感谢您的任何提示!
you can automate apps using appium to learn. 您可以使用appium自动化应用程序来学习。 download any sample app to ur machine,
下载任何示例应用程序到您的机器,
try adding ur app path that u have in ur local machine that need to be pushed to device using , 尝试添加您在本地计算机中需要推送到设备的应用程序路径,
caps.setCapability("app", "C:\\Users\\...\\yourappname.apk");
to find the app activity name, in cmd prompt hit 在cmd提示符下找到应用程序活动名称
aapt dump badging "fullpath to ur apk in machine"
scroll down and find the value of the parameter 向下滚动并找到参数的值
launchable-activity
and replace it with your app package value in capablities 并将其替换为您在应用程序包中的应用程序包值
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.