What is noReset in Appium?
noReset is used to maintain the state of the application. It is defined as true or false boolean value.
More information on noReset can be found here.
When running automated tests using Real Devices on Sauce Labs, you might notice that setting noReset to any boolean value (true/false) on an iOS test will always show the value as true, despite the documentation which indicates that noReset set to false being the default on Sauce Labs.
When noReset:false capability is specified, the application will be uninstalled and re-installed as part of each session. However, incase of iOS tests on Real Devices, customers will always see noReset set to true in appium log file which often leads to confusion.
In short, when running a test on Sauce by either explicitly setting noReset:false or not specifying the capability, the default is set to false.
Note: noReset has to be used in conjunction with cacheId in order to work.
More information on cacheId can be found here.
To change the value of noReset, it has to be used in conjunction with cacheId.
-
false (or not set): the app under test gets re-installed between cached sessions
-
true: the app stays on the device between cached sessions
When using cacheId and noReset:true, your app under test and its data will remain as-is on the device between sessions. We are not making any changes.
When using cacheId and noReset:false, your app under test will be uninstalled/re-installed between sessions without retaining any prior app state.
If you would like to confirm that the device was indeed reused, you can look for used_cached_device:true value in the Network Request tab of your test.
- Open your session
- Open Dev tools of you local browser
- Open the Network Tab
- Filter by "job"
- Click on the Job id
- You should see used_cached_device: true or used_cached_device: false