Resetting app test data for android emulator/ios simulator

Hi
I have some feature files which require the user to login in order to execute functionality in the app. I would like each test to start from fresh and login however after the first test is run, I can see that when the app is reopened the user is still logged in. I have tried a combination of noReset and fullReset values however noReset doesnt seem to do anything - app launches, waits for a bit on login screen and closes without the tests actually running till the end and with fullReset the first test passes but the second one doesn’t. Can someone help? I have been trying so many different solutions and nothing is working.

I can’t see any specific errors in the console so it’s harder to debug what might be wrong.This text will be hidden

The reset strategies table might help:

https://appium.io/docs/en/writing-running-appium/other/reset-strategies/

Hi wreed,
As I mentioned I have tried the reset strategies with no luck.

Honestly your description sounds like a misunderstanding of how fullReset and noReset work. You state clearly that noReset doesn’t do anything, which I know is not true.

Maybe share your code?

From my understanding, noReset:false should clear the app data before each test. However, the second test fails because on app launch, the user is still logged in. If app data is cleared, shouldn’t the test start from fresh? It mostly looks like the app is killed as soon as the tests start. I also haven’t seen appium logs in the VS code terminal to help me understand what could be wrong.

Could you explain your understanding of noReset and fullReset? I’d be happy to get a second opinion. I’ve been researching all over the internet for the last 3 days.

With regards to the code, there’s not really much to it. The tests are logging in and looking for some elements on a specific screen in the app. There are no logout steps or anything like that and I’m also not using any after hooks logic.

Lots of unknowns here. iOS/Android/Both? Language? Test Framework?

You are using VS code so maybe Java? If you are using Java, maybe TestNg?

This is where it would be good to see some code and possibly a log. Best way to share a log is with a git gist. I’d like to help you, but I need you to help me help you.

I feel that there is some problem beyond just reset strategies. Reset strategies should not cause the app to be killed as soon as the test starts.

just set fullReser:true it should do the work if I understood you test case correctly, don’t try to combine it with noReset if you just want the app to relaunch then, you should get a fresh test with login data cleared.

Hi, I am facing the same issue, any solution so far, the logout from the app is hard as in each test case it dives deep inside the views of the app