Way to resetApp faster?


#1

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("http://127.0.0.1:" + porta + "/wd/hub"), cap);
    return driver;
}

}


#2

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


#3

@mykola-mokhnach thanks it worked better