Appium StartActivity() Function
I am new to Appium, In my code I have given required desired capabilities and wrote one test case that is working fine. Now I want to launch another App for second test in same cod
Solution 1:
Seems like you are trying to use the method with a WebDriver
instance.
The startActivity
method is provided by an interface StartsActivity
implemented by AndroidDriver
only. So ideally this shall work :
((AndroidDriver) driver).startActivity(<appPackage>, <appActivity>);
Solution 2:
public static void start() {
try {
((AndroidDriver) driver).startActivity("com.example.test", "com.example.LaunchApp");
} catch (Exception e) {
e.printStackTrace();
}
}
You have to enter your app package name and activity name to maximize the app.
Post a Comment for "Appium StartActivity() Function"