IOS app gets reset when creating a new appium session

Follow these steps

  • Install the features and launch the ABC app. Providing the path to the application

    capability.setCapability ("app", "/Users/changdeojadhav/Library/Developer/Xcode/DerivedData/ABC/Build/Products/Debug-iphonesimulator/ABC.app"); capabilities.setCapability ("BundleID", "com.abc.ABC-Demo");

  • Follow some steps

  • exit driver.quit() driver
  • Install features for the Xyz app. And run the XYZ app.
  • Follow some steps
  • exit driver.quit() driver
  • restart the ABC application as indicated in step # 1. It is expected that "the ABC application should save its state", but ABC receives a reset. I started appium with the -no- reset option. Any idea what I'm missing here Thanks
+1
ios ios-ui-automation appium
source share
4 answers

As far as I can tell, there is currently no solution for reopening the application after going to the main screen without clearing the application from the cache.

In previous versions of iOS / Appium, the solution had to fulfill:

 from appium import webdriver driver = webdriver.Remote('http://0.0.0.0:4723/wd/hub', desired_caps) driver.close_app() app = driver.find_element_by_xpath('//UIAApplication/UIAWindow/UIAScrollView/UIAButton[@name="sampleApp"]') app.click() 

However, this is currently causing Appium to crash.

I will update this question when I register a github problem for it.

0
source share

The Appium help page says that it only supports a few application tests in one test session for Android without Selendroid:

iOS : support for automating multiple applications in one session: No

Android : support for automating multiple applications in one session: yes (but not when using the Selendroid backend)

http://appium.io/slate/en/master/?ruby#toc_27

I assume that is why you have this problem, and this is most likely a problem with / Xcode tools.

0
source share

I managed to restart the same application without restarting its state with Appium 1.3.1, working with Xcode 6.1 on Mac Mini, working with Mavericks. I did not try to run another application between starts. I control automation with C #.

  protected AppiumDriver GetAppiumDriver(bool forRestart = false) { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.SetCapability("appium-version", "1.0"); capabilities.SetCapability("platformName", "iOS"); capabilities.SetCapability("platformVersion", "7.1"); capabilities.SetCapability("deviceName", "iPhone Simulator"); capabilities.SetCapability("app", _appPath); capabilities.SetCapability("locationServicesEnabled", true); if (forRestart) { capabilities.SetCapability("noReset", true); } AppiumDriver driver = new AppiumDriver(_serverUrl), capabilities, new TimeSpan(0, 5, 0)); return driver; } public void iOSMobileAppBasicUITest() { // Initially Launch the app with the noReset capability at its default value of false to ensure a clean starting point. _driver = GetAppiumDriver(false); //Shut down the app. _driver.Quit(); // Launch the app again, this time with the noReset capability set to true. _driver = GetAppiumDriver(true); // Use _driver to do whatever UI automation is desired. // Optional: Send the app to the background so that iOS does state preservation. _driver.BackgroundApp(3); // Close the app. _driver.CloseApp(); // Alternative: _driver.Quit(); // Launch the app. _driver.LaunchApp(); // Alternative: _driver = GetAppiumDriver(true); ... 
0
source share

As I already knew, Appium works by default in fast reset mode, and tries to clear application data after the session ends (as a result of calling quit() in this case). If you want to save application data, the option --no-reset will work for you.

-one
source share

All Articles