Need Appium code to relanch app in between test case

5.4k Views Asked by At

I am new to automation(looking for help), My scenario is - I need to restart the app and have to check the last data inserted should be auto saved

driver.closeApp is not working ( i already tried) And I don't want to use this code in app launch method, I want to make an another method for that

1

There are 1 best solutions below

0
Shiv On

1.You can use following method to put you application in background, it will relaunch the application after 10 sec automatically, after relaunch app will make server calls :

 driver.runAppInBackground(Duration.ofSeconds(10));
  1. Reset the currently running app for this session and wait until it is installed again.

    driver.resetApp();

  2. Terminate the app and activate again , pass Package name for Android

    driver.terminateApp('com.apple.Preferences'); driver.activateApp('com.apple.Preferences');