我是appium-android的新手。为一个应用程序编写脚本。我必须将App介绍页面切换到主要登录活动。怎么做?
您可以开始新活动,如下所示
1.创建Activity类对象
Activity activity = new Activity("app package goes here", "app activity goes here");
2.将对象传递给startActivity方法
driver.startActivity(activity);
3.如果需要,您可以根据appPackage和appActivity名称添加等待
activity.setWaitAppPackage("app wait package goes here");
activity.setWatAppActivity("app wait activity goes here");
@Test
public void startActivityInThisAppTestCase() {
Activity activity = new Activity("app package goes here",
"app activity goes here");
driver.startActivity(activity);
assertEquals(driver.currentActivity(),
"app switched activity goes here");
}如果您想查看更多Activity类的测试用例,请按照此link进行操作
如果您想查看startActivity方法的库详细信息,请遵循此link