When you train and run a mobile test, mabl takes steps to make sure that the test uses a clean application and device. Clearing the application and device state ensures that your application behaves consistently during training and execution. This article explains how mabl handles application and device state for mobile tests:
Cloud training
Every cloud training session uses:
- A freshly installed version of the application under test
- A new virtual instance with a default state provided by Android or iOS
Local training
Every local training session uses:
- A freshly installed version of the application under test
- The current state of your local virtual device
mabl takes precautions to put the device in a clean state but cannot guarantee that your local device is in a clean state. If your emulator is not behaving as expected, try cloud training instead.
Playing back steps in the Trainer
mabl automatically adds a default step to the beginning of every mobile test: "Launch and initialize app session." This step uninstalls and reinstalls the application under test and resets the mobile device state.
If you want to play back test steps in the Trainer, the "Launch and initialize app session" step at the beginning of the test ensures the application and device are in the correct state before proceeding with the rest of the test steps.
Cloud runs
Every cloud run uses:
- A freshly installed version of the application under test
- A new virtual instance with a default state provided by Android or iOS.
Since mobile tests already start with a clean device and application state in cloud runs, the initial "Launch and initialize app session" step is a no-op.
Local runs
Every local run uses:
- A freshly installed version of the application under test
- The current state of your local virtual device.
The first step of the test - "Launch and initialize app session" - ensures the application and device are in the correct state before proceeding with the rest of the test steps.
Test execution environments
For more information on the general differences between local and cloud runs, check out the test execution overview article.