Change an apps settings in the Settings app and then navigate back to the app

Hi guys/gals,

I need to set some settings for the app under test on iOS. I have been doing this by navigating to the settings app, changing the setting, quitting the driver, starting the driver pointing at the app to test.

The problem seems to be that settings are not being saved when I close the settings app. If I reopen the settings app manually none of the selected options are set.

I have noReset: true in my capabilities file, and I make sure the application is installed before setting the settings.

Any help much appreciated, I’ve been stuck on this for too many hours.

In iOS platform using appium you cannot go out of test app and perform any action. I believe this may be because of apple restrictions.

In android platform it works by starting a new activity and then minimize it.

@amitjaincoer191 for iOS you CAN got to settings BUT on Simulator only :slight_smile:

Thanks. Any pointers how to do for simulator ?
Is this feature was present in earlier versions of appium also like 1.3.4/1.4 ?

@amitjaincoer191 it was always. i used it and press Home button and open settings (we changed some app settings before test).
@pmck91 later to return in same session to client i did:

try {driver.runAppInBackground(1)} catch (Exception e) {}

Ok. But I learnt that pressKeyCode(KEYS.ANDROID_HOME) method works only on android platform for pressing any specific key.

@amitjaincoer191 i press Home with the help of osascript.