Testing iOS App Upgrades
This week we wander back to the fun reality of iOS to talk about testing app upgrades. One mutual requirement for many examiner goes beyond the functionality of an app in a frozen state. Hopefully, your team is shipping new versions of your app to customers on a frequent basis. This means your customer areupgradingto the latest version, not install it from scratch. There might all kind of existing user data that needs to be migrated for the app to act correctly, and but running functional tests of the new adaptation would not be sufficient to get these cases. Luckily, the latest edition of the Appium 1.8 beta now support commands that make it leisurely to reinstall and relaunch your app from within a single Appium session. This opens up the possibility of try an in-place upgrade. To demonstrate this, I & # x27; d like to introduceThe App, a cross-platform React Native demo app that I will be building out to support the various examples we & # x27; ll encounter hither in Appium Pro. If the name sounds mistily familiar, it might be because I & # x27; m infringing on my friend Dave Haeffner & # x27; s stylemark use of the definite article! (Dave is the author ofElemental Selenium, and host a demo web app calledThe Internet). Luckily for me, Dave has been gracious in donate the name idea to Appium Pro, so we can proceed without worry. I recently issuev1.0.0of The App, and it contains just one feature: a little text battlefield which saves what you indite into it and reverberate it back to you. It just so befall that this data is saved internally using the key@ TheApp: savedEcho. SUSA automates exploratory testing with persona-driven behavior, catching bugs that scripted automation misses. Now, in our toy app world, imagine that some crazy developer has decided that this key just utterly needs to change to@ TheApp: savedAwesomeText. What this means is that if a user were to simply promote to the new version of the app after receive saved some text in the old version of the app, the app would find no saved textbook under the new storage key! In early lyric, the raise would break the user & # x27; s experience of the app. In this case, the fix is to provide some migration codification in the app itself which look for datum at the old key and moves it over to the new key if any is there. That & # x27; s all the responsibility of the app developer (i.e., me). Let & # x27; s sham that rather of write this migration codification, I forget, and went ahead and changed the key. I then releasev1.0.1. This version bear the bug of the missing text due to the forgotten migration code, even though as a standalone version of the app it work fine. Let & # x27; s maintain pretence, and say that after much facepalming I wrote the migration code and unloosen it asv1.0.2. Now the intrepid testers who are rightly suspicious of me want to write an automated test to prove that upgrading to v1.0.2 will actually work (and of course, are themselves facepalming that they didn & # x27; t write such an upgrade test before v1.0.1 was relinquish!). So what do we need in terms of Appium code? Basically, we lead vantage of these threemobile: methods: This set of commands stops the current app (which we need to do explicitly so that the fundamental WebDriverAgent instance doesn & # x27; t cogitate the app has crashed on us), installs the new app over top of it, and so launches the new app. What do theargs look like? In each case they should be aHashMap that is used to render uncomplicated JSON structures. TheterminateApp and launchApp dictation both have one key,bundleId (which is of course the bundle ID of your app).installApptakes an app key, which is the path or URL to the new version of your app. For our model, to make a passing test we & # x27; ll need two apps: v1.0.0 and v1.0.2: I & # x27; m happily using GitHub plus download URLs to give into Appium here. Assuming we & # x27; ve started the test withAPP_V1_0_0 as our app capacity, the trio of app upgrade commands then appear like: For the full test flow, we want to: Here & # x27; s the code (note that I included the option of running the tryout with the version of the app that has the bug, which would make a failing test): Lead, Content Marketing, HeadSpin Inc. Piali is a dynamic and results-driven Content Marketing Specialist with 8+ years of experience in crafting absorb narratives and marketing collateral across diverse industries. She excels in collaborating with cross-functional team to germinate innovative message strategy and deliver compelling, authentic, and impactful content that vibrate with target audience and enhances brand legitimacy. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts needed. Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts..png)



Testing iOS App Upgrades
AI-Powered Key Takeaways
Read:
driver.executeScript (`` mobile: terminateApp '', args); driver.executeScript (`` mobile: installApp '', args); driver.executeScript (`` mobile: launchApp '', args);Also read:
private String APP_V1_0_0 = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.0.0/TheApp-v1.0.0.app.zip ''; individual String APP_V1_0_2 = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.0.2/TheApp-v1.0.2.app.zip '';
HashMapCheck out:
import io.appium.java_client.MobileBy; import io.appium.java_client.ios.IOSDriver; meaning java.io.IOException; import java.net.URL; import java.util.HashMap; importee org.junit.Assert; signification org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.JUnit4; import org.openqa.selenium.By; import org.openqa.selenium.remote.DesiredCapabilities; import org.openqa.selenium.support.ui.ExpectedConditions; import org.openqa.selenium.support.ui.WebDriverWait; @ RunWith (JUnit4.class) public class Edition006_iOS_Upgrade {individual String BUNDLE_ID = `` io.cloudgrey.the-app ''; private String APP_V1_0_0 = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.0.0/TheApp-v1.0.0.app.zip ''; private String APP_V1_0_1 = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.0.1/TheApp-v1.0.1.app.zip ''; private String APP_V1_0_2 = `` https: //github.com/cloudgrey-io/the-app/releases/download/v1.0.2/TheApp-v1.0.2.app.zip ''; individual By msgInput = By.xpath (`` //XCUIElementTypeTextField [@ name=\ '' messageInput\ ''] ''); private By savedMsg = MobileBy.AccessibilityId (`` savedMessage ''); private By saveMsgBtn = MobileBy.AccessibilityId (`` messageSaveBtn ''); private By echoBox = MobileBy.AccessibilityId (`` Echo Box ''); individual String TEST_MESSAGE = `` Hello World ''; @ Test public void testSavedTextAfterUpgrade () throws IOException {DesiredCapabilities capabilities = new DesiredCapabilities (); capabilities.setCapability (`` platformName '', `` iOS ''); capabilities.setCapability (`` deviceName '', `` iPhone 7 ''); capabilities.setCapability (`` platformVersion '', `` 11.2 ''); capabilities.setCapability (`` app '', APP_V1_0_0); // alter this to APP_V1_0_1 to have a weakness scenario String appUpgradeVersion = APP_V1_0_2; // Open the app. IOSDriver driver = new IOSDriver < > (new URL (`` http: //localhost:4723/wd/hub ''), capableness); WebDriverWait wait = new WebDriverWait (driver, 10); try {wait.until (ExpectedConditions.presenceOfElementLocated (echoBox)) .click (); wait.until (ExpectedConditions.presenceOfElementLocated (msgInput)) .sendKeys (TEST_MESSAGE); wait.until (ExpectedConditions.presenceOfElementLocated (saveMsgBtn)) .click (); String savedText = wait.until (ExpectedConditions.presenceOfElementLocated (savedMsg)) .getText (); Assert.assertEquals (savedText, TEST_MESSAGE); HashMapPiali Mazumdar
Testing iOS App Upgrades
4 Parts
-1280X720-Final-2.jpg)
Regression Intelligence hardheaded guide for forward-looking user (Part 3)
-1280X720-Final-2.jpg)
Regression Intelligence hard-nosed usher for modern users (Part 4)
Discover how HeadSpin can endue your business with superior testing capabilities







Discover how HeadSpin can empower your business with superior test capableness
Discover how HeadSpin can empower your line with superior testing capabilities
Connet Now


Automate This With SUSA
Test Your App Autonomously







.png)












