Unable to close application when keyword Mobile.startExistingApplication is being used

Hi,

Recently I was experimenting with the usage of keyword Mobile.startExistingApplication.
I’ve observed when using this keyword the app isn’t closed after execution of Mobile.closeApplication().
This behavior doesn’t occur when keyword Mobile.startApplication is being used.

I’m almost certain this is a bug in Katalon Studio, therefore I’ve recently created bug ticket Closing existing app doesn't work.

Maybe I’m looking at it the wrong way, that’s why I’ve created this topic to get some community input.

Test was executed on:
WIN 10 build 1903
Appium 1.14.0
Katalon Studio (7.1.2 and 8.0.0)

2 Likes

@duyluong @Zarashima @Chris_Trevarthen Could you shed your light on this subject and possibly give some insights?

Hi @streamgroup.testing,

I confirmed that Mobile.closeApplication() doesn’t close an application started via Mobile.startExistingApplication() on Android.

I found that you can use the following the close the app, though:

Add this import to your test:

import com.kms.katalon.core.mobile.keyword.internal.MobileDriverFactory
import io.appium.java_client.AppiumDriver

Then add this code to terminate the app, where com.myapp.id is the bundle id you used in Mobile.startExistingApplication.

AppiumDriver<?> driver = MobileDriverFactory.getDriver();
driver.terminateApp('com.myapp.id')

Hope this helps,

Chris

2 Likes

This greatly affects us, for now, when executing Test Suites, the app does not reset to it’s initial screen.

We kindly request a workaround.