Way to resetApp faster?

Is there a faster way to resetApp ?
I´m using driver.resetApp(); at my @afterMethod
My suite is taking too long to do (45 min for 27 test cases).

Here´s my core:

public class Core {
public static AndroidDriver capabilitites(String device, int porta) throws MalformedURLException {

    AndroidDriver driver;

    DesiredCapabilities cap = new DesiredCapabilities();
    cap.setCapability(MobileCapabilityType.PLATFORM_NAME, MobilePlatform.ANDROID);
    cap.setCapability(MobileCapabilityType.DEVICE_NAME, "device");
    cap.setCapability(MobileCapabilityType.UDID, device);
    cap.setCapability(MobileCapabilityType.NEW_COMMAND_TIMEOUT, "120");
    cap.setCapability(AndroidMobileCapabilityType.AUTO_GRANT_PERMISSIONS, "true");
    cap.setCapability(AndroidMobileCapabilityType.APP_PACKAGE, "com.br");
    cap.setCapability(AndroidMobileCapabilityType.APP_ACTIVITY, "com.MainActivity");
    driver = new AndroidDriver(new URL("" + porta + "/wd/hub"), cap);
    return driver;


simply quit and start the driver again. resetApp does the same in an ugly way

1 Like

@mykola-mokhnach thanks it worked better