Android app restarts after each test case

Hi, i am using Katalon to test a few native Android apps and until a few Katalon versions ago it was working perfectly fine.

The issue i am experiencing: Every time i try to run a test suite it will restart the application on my real android device, it did not do this before in old Katalon versions. The android app needs to load allot of data from different servers before it’s fully started which usually takes up close to 40 seconds…

Restarting the app after each test case renders the whole automation useless for me… is there any way to stop restart the app after each test case when executing a test suite?

* returning to an old katalon version does not resolve the issue.
* unchecking the terminate drivers after each test case in the default project execution settings does not help

Which Appium and Android version you are using?

Based on this article: appium/reset-strategies.md at master · appium/appium · GitHub, you can try to use noReset instead:

Screen Shot 2018-01-18 at 18.21.38.png

Hi Robin,
the first test step in your recording would be “start the application”. change the value to “false” from true for the param “UninstallAfterCloseApp”. as below.

Thanks,
Mosaj

Capture.PNG

1 Like

Katalon: 5.3.0.1
Java: 1.8.0_102
Appium: 1.7.2

But it’s still not working with those settings…

I managed to work around this using the test listeners

class TestListener {
	def isTestSuite = false
	@BeforeTestCase
	def beforeTestCase(TestCaseContext testCaseContext) {
    	   if(!isTestSuite){
		Mobile.startApplication(GlobalVariable.APK_PATH, false)
	   }
	}
	@AfterTestCase
	def afterTestCase(TestCaseContext testCaseContext) {
	   if(!isTestSuite){
           	Mobile.closeApplication()
	   }
	}
	@BeforeTestSuite
	def beforeTestSuite(TestSuiteContext testSuiteContext) {
           isTestSuite = true
	   Mobile.startApplication(GlobalVariable.APK_PATH, false)
	}
	@AfterTestSuite
	def afterTestSuite(TestSuiteContext testSuiteContext) {
	   isTestSuite = false
           Mobile.closeApplication()
	}
}

Robin said:

I managed to work around this using the test listeners

class TestListener {
def isTestSuite = false
@BeforeTestCase
def beforeTestCase(TestCaseContext testCaseContext) {
	   if(!isTestSuite){
	Mobile.startApplication(GlobalVariable.APK_PATH, false)
   }
}
@AfterTestCase
def afterTestCase(TestCaseContext testCaseContext) {
   if(!isTestSuite){
       	Mobile.closeApplication()
   }
}
@BeforeTestSuite
def beforeTestSuite(TestSuiteContext testSuiteContext) {
       isTestSuite = true
   Mobile.startApplication(GlobalVariable.APK_PATH, false)
}
@AfterTestSuite
def afterTestSuite(TestSuiteContext testSuiteContext) {
   isTestSuite = false
       Mobile.closeApplication()
}

}


  

Thanks It worked to me

@satya where to add this listener?