How to test switching from app to another app at the runtime in katalon?

I have a scenario testing. I have an email notfication on outlook. I have a link in the email. Click to the link, an another mobile application will be opened.
I just know that katalon only supports to open and test only one application at the runtime.
Is there any way to cover this test case. Any help is appreciated. Thanks in advance.

@Ste_Duong Only one device is testable at a time. we can’t do parallel test

1 Like

@Gnanavel I mean I want to test 2 applications in one device at a time. Not 2 devices. I want to test the integration between 2 applications

@Ste_Duong its possible you need to create 2 instances Driver like below.

public AppiumDriver<MobileElement> driver =  null ;


     String calculatorAppPackageName =  "com.sec.android.app.popupcalculator" ;

     String calculatorAppActivityName =  "Calculator" ;

     String settingsAppPackageName =  "com.android.settings" ;

     String settingsAppActivityName =  "com.android.settings.GridSettings" ;

 

     @BeforeTest

     public void setupstart()  throws MalformedURLException {

         DesiredCapabilities capabilities = DesiredCapabilities.android();

         capabilities.setCapability(MobileCapabilityType.AUTOMATION_NAME,  "Appium" );

         capabilities.setCapability(MobileCapabilityType.PLATFORM_NAME,  "Android" );

         capabilities.setCapability(MobileCapabilityType.DEVICE_NAME,  "4100b79b459381f7" );

         capabilities.setCapability( "appPackage" , calculatorAppPackageName);

         capabilities.setCapability( "appActivity" , calculatorAppActivityName);

         driver =  new AndroidDriver<MobileElement>( new URL( "http://localhost:4723/wd/hub" ), capabilities);

     }

 

     @Test

     public void calcTest1()  throws Exception {

         //Multiply 2 numbers in calculator app

         driver.findElement(By.xpath( "//android.widget.Button[@text='4']" )).click();

         driver.findElement(By.xpath( "//android.widget.Button[@content-desc='Multiplication']" )).click();

         driver.findElement(By.xpath( "//android.widget.Button[@text='4']" )).click();

         driver.findElement(By.xpath( "//android.widget.Button[@content-desc='Equal']" )).click();

 

         // launch settings App

         Activity activity =  new Activity(settingsAppPackageName, settingsAppActivityName);

         activity.setStopApp( false );

         ((AndroidDriver<MobileElement>) driver).startActivity(activity);

 

         // Switch OFF WIFI

         driver.findElement(By.xpath( "//android.widget.LinearLayout[@content-desc='Wi-Fi']" )).click();

         driver.findElement(By.className( "android.widget.Switch" )).click();

 

         // Re launch calculator App

         activity =  new Activity(calculatorAppPackageName, calculatorAppActivityName);

         activity.setStopApp( false );

         ((AndroidDriver<MobileElement>) driver).startActivity(activity);

         String result = driver.findElement(By.className( "android.widget.EditText" )).getText();

         System.out.println( "Result : " + result);

 

     }

 

     @AfterTest

     public void tearDown() {

         driver.quit();

     }

}
1 Like

@Gnanavel
I am implementing a script where I want to switch between apps on different android devices. Can someone please help me out here.

@Ste_Duong
I am implementing a script where I want to switch between apps on different android devices. Can someone please help me out here.