Max runtime for an Appium test on iOS and/or Android physical device?

I was wondering, if I run a test against a physical iOS or Android device with Appium, how long is Appium able to run the test before it terminates itself (due to timeout or something) or I end the test specifically inside the test.

Let’s say I had a test scenario where I want to launch and run an app for a long time (e.g. say 15 min, 1 hr, 24 hrs). The test may launch app, perhaps sleep for the desired long interval then resume to validate some stuff or end the test when resume from sleep.

Asking this as most mobile app tests like web app tests are not meant to run long. But I have some scenarios where I do want to run long time, and would like to know what Appium’s time limits might be if any.

Although I will try it out eventually when I get a chance, but wanted to know if anyone knows the answer to this or has some experiences around it.

hi.
our android client testSuite running about 45min.
iOS client was running about 50min for 2 emulators (normally iPhone + iPad) BUT! with latest problem in instrument delay now it is taking for 6h (we pray for Appium 1.5 to fix problem)

regarding the LONG one time tests e.g. stress test for app or Google Analytic tests (these tests not in main suite) maximum we running about 45min.

With long waiting (Google Analytics normally takes 5-7min to detect changes) we use logic to re-establish connection to device/emulator if it dies (by default it is 120sec to die).

@Aleksei Can you give some pointer on how do you check if connections till exists and how do you reestablish. Thanks

we can check like:

try {
            System.out.println("  check driver alive: "+driver.getContext());
        } catch (Exception e) {
            System.out.println("  driver not found. starting driver...");
            driver = getDriver("iOS", runDestinationPublic, deviceName, osVersion, outputDirectory);
        }
// where
//  driver is:
protected static AppiumDriver driver;

// getDriver is:
protected AppiumDriver getDriver(String devicePlatform, String runDestination, String deviceName, String osVersion, String outputDirectory) throws Exception {
//here is some code to start needed driver based on needed
// platform (Android or iOS), device (real device or simulator) and runDestination (e.g. local or remote some phone provide like SauceLab)
}

thanks @Aleksei it would be a nice feature to make automation more stable. I have a scenario where when I click Force Sync button then it would test app around 3 hours to erase and download data from scratch.

@Aleksei…just out of curiosity what value you give to newCommandTimeout

120sec. but not sure if it working with us :slight_smile: in terms if something will change if set e.g. 60sec

Hi,

can I do 24 hrs test for android and ios by plugging the real device?

Thanks,
Chinmay