Ignore an instruction in test suits

How I can ignore the start app statement in test cases i if I run test suites

@aobaid The way I have gotten this to work is to use a try/catch statement on the setup area. This can be on each test or inside a test listener. The try will attempt to grab the existing appium driver and if that fails it will call the start app command. There may be a better way to do this but this has worked for me:

//setup
AppiumDriver<?> driver
try {
	driver = MobileDriverFactory.getDriver()
	driver.resetApp()
} catch (Exception startApp) {
	Mobile.startApplication(appID, false, FailureHandling.STOP_ON_FAILURE)
	driver = MobileDriverFactory.getDriver()
}
1 Like