How to switch from one native app to another native in between execution in local? – pCloudy – Question and Answers
Home >> Appium Tricks and Tricks >> How to switch from one native app ...

How to switch from one native app to another native in between execution in local?


Code Snippet:

// App1 capabilities
String AppPackageName = "io.cloudgrey.the_app";
String AppActivityName = "io.cloudgrey.the_app.MainActivity";

// App2 capabilities
String PcloudyDemoAppPackageName = "com.pcloudy.appiumdemo";
String PcloudyDemoAppActivityName = "com.ba.mobile.LaunchActivity";

//Lunch App1
Activity activity = new Activity(AppPackageName, AppActivityName);
activity.setStopApp(false);
((AndroidDriver < MobileElement > ) driver).startActivity(activity);

//Lunch APP2
Activity activity = new Activity(PcloudyDemoAppPackageName, PcloudyDemoAppActivityName);
activity.setStopApp(false);
((AndroidDriver < MobileElement > ) driver).startActivity(activity);

Leave a Reply

Your email address will not be published. Required fields are marked *