question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

reset command does not reset app data in iOS when noReset is set to true

See original GitHub issue

The reset command does not reset app data in iOS when noReset is set to true. In Android the app data is reset. So it is an inconsistent behavior. I’ve tested this with the iOS Emulator (iPhone 6, 8.2) and Android 4.4.4 on a real device.

Use case why this is relevant:

I want to set noReset to true so that I can restart the app with closeApp -> launchApp without losing the app data and use resetApp to manually reset the app data before each test scenario.

Having a restartApp command (https://github.com/appium/appium/issues/4955) would be an alternative for my specific use case.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
IntelloScoobycommented, Feb 25, 2016

I was also facing the same issue. In iOS, when we have noReset=true, resetApp() does not reset the app but instead has the same behavior as closeApp(). In Android, with same setting, resetApp() resets the app and closeApp() just closes it. Below is a workaround that I followed, I created a custom method which would set the value of noReset setting and open a new driver. Another method, to reset the value of noReset and open new driver. Then I am calling these methods as and when required.

Below is the sample code:

public void setNoResetSetToTrue() throws Throwable {
        if (platformName.equals("iOS")){
            capabilities.setCapability("noReset",true);
            driver = new IOSDriver(appiumURL, capabilities);
        }
    }

public void setNoResetToFalse() throws Throwable {
        if (platformName.equals("iOS")){
            capabilities.setCapability("noReset",false);
            driver = new IOSDriver(appiumURL, capabilities);
        }
    }
0reactions
lock[bot]commented, Apr 29, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does noReset seems to always be set to true on iOS ...
For iOS tests on Real Devices, customers will always see noReset set to true. This means DO NOT reinstall the app. A double...
Read more >
NoReset and FullReset in Appium - selenium - Stack Overflow
The accepted answer is not correct. If noReset is set to TRUE, the app data will NOT be cleared before this session starts....
Read more >
Difference between noReset and fullReset? - Appium Discuss
When: noReset: false, fullReset: true: It clears the cache and UNINSTALL the app. noReset: true, fullReset: false: It does not clear the cache ......
Read more >
Reset Strategies - appium - Read the Docs
Reset Strategies. Automation Name, default, fullReset, noReset. iOS (including XCUITest), Shut down sim after test. Do not destroy sim. Do not uninstall app...
Read more >
Handle permission pop-ups in your Appium tests - BrowserStack
Note: If noReset cabability is set to true, autoGrantPermissions capability doesn't work. 2. Allow or deny all permissions for iOS apps. To test...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found