qwerty
qwerty

Reputation: 1

How to reset application in appium

I have a feature file with few scenarios:

in every scenario I need to login in app and then do checks

But if first scenario failed on step after login, it does not perform logout

and then second scenario is failed.

How to bring app to first state? (start app, and not logged in)

driver.resetApp() does not work for me

Upvotes: 0

Views: 12731

Answers (1)

CEH
CEH

Reputation: 5909

If driver.resetApp() does not work for you, you can try to write this into the desired capabilities instead.

Try adding the fullReset capability to your driver options -- this is based on this GitHub discussion from Appium:

options.AddAdditionalCapability("fullReset", "true");

If you do not wish to reset the app, but actually just close & restart it, you can use:

driver.closeApp();

driver.launchApp();

Upvotes: 2

Related Questions