Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Any way to put app in background and relaunch in Appium iOS

Is there any way to do the following process in iOS Automation using Appium?

  1. Press home button.
  2. Put app in background.
  3. Open some other app (say Gmail) -> do operations there.
  4. Then relaunch our app and resume the methods check.

I tried these:

RemoteWebDriver wd = null;
wd.close();

But it just quits the app (just like wd.quit()) which I am automating and then when I try relaunching -> it starts from the scratch. I am running it on an iPhone simulator.

like image 283
Smriti Avatar asked Dec 11 '22 07:12

Smriti


1 Answers

Appium actually does provide client libraries that allow you to close the app, relaunch it (without starting from scratch), lock the sim, etc.

Libraries to do this exist in C#, Python, and Ruby as well as Java.

Migrating to those WebDrivers rather than selenium's WebDriver is SUPER simple and recommended, as you get access to all the goodies the Appium team added (like shaking your device, complex tapping, locking the device, etc)

like image 154
Jess Avatar answered Dec 26 '22 05:12

Jess