0

I am using appium 8.1.1 java client, I am trying to use driver.resetApp() in my code for IOS app, but it shows as The method resetApp() is undefined for the type AppiumDriver

  • What exactly are you trying to achieve? Restart the app or reset the app data? Resetting the app data has never been possible on iOS (or at least for a long, long time) - the only way to reset the app data on iOS is to re-install the app. – drunkencheetah Jul 14 '22 at 05:03
  • Basically i want to close and launch the app to the same page, is it possible? – keerthiga jayakumar Jul 14 '22 at 08:15
  • I took a quick glance at the Java docs for 8.1.1 and for me the way to go would probably be: `driver.terminateApp(); driver.activateApp();` This will close the app and re-open it - it will not bring you back to the last screen though. To just minimize and bring back you can try: `driver.runAppInBackground​();` – drunkencheetah Jul 14 '22 at 09:38

1 Answers1

0

I guess the reason is that you have the generic appium driver that can be "anything" (android ios windows etc)

if you want the functions that are for a specific mobile driver you would probably have to cast it to that driver type. eg

((IOSDriver) driver).resetApp()

you can still use this, however these are also deprecated methods. I'm yet to upgrade my code as well removing these, this is the forum I saved to do it in the future:

https://applitools.com/blog/whats-new-appium-java-client-8/

Jano
  • 401
  • 1
  • 5
  • 14