The OS upgrade notifications as well as other OS level notifications have sparked some serious discussion inside test automation ecosystem. These notifications and reminders that you should update your OS to the latest and greatest are necessary and often solve variety of issues that apps and other stuff have on OS platform. However, from the test automation point of view those can be very tricky as test runs get jammed and huge number of test runs are getting queued. We’ve seen this same here at Testdroid and I’ll walk you through some of the basic options that you can use to get rid of those notifications.
Clearly, OS upgrade notifications are meant to be reminders to keep your OS version up to date and including all the possible features that Apple, Google as well as some Android OEMs are pushing into their platforms. As said, test automation folks have had issues with these pop-up notifications for various reasons. For example, some companies that determined that they should keep some of their devices with the old OS versions and therefore they don’t want to upgrade to the latest version.
What happens in case like this? They’ll get notification telling them to upgrade OS version EVERY DAY. Even running some large device farms on premises, this causes significant overhead and manual effort to ensure all devices have been checked for notifications. ‘Remind Me Later’ on iOS causes the most effort and some DevOps folks have been frustrated to with the daily click on that.
There are bunch of other reasons why people do not want to upgrade to the latest one but instead let’s take a look on few options that you can do to get test runs running smoothly with this notification issue.
Use Private or On-Premise Device Farms to Avoid Notification Pop-ups
This is probably the best option available at the moment. You can block all updates on Apple devices and not to get update notification about the new version. This block can be done with sophisticated private device farms or on-premise products, such as Testdroid Enterprise, that can fully block any update for iOS devices. For example, Testdroid Enterprise and Testdroid PrivateCloud provides you a mechanism to block upgrade on the iOS devices. And as the OS versions and platforms evolve, there will be new challenges but that’s exactly why these products have been created – to tackle the new and next challenge that you will see with your devices.
However, it’s important to note that when you block the capability of upgrading on your iOS devices you are unable to upgrade/update any software from Apple until you reverse this option.
The good news is that we haven’t experienced any issues after blocking these upgrades, but naturally there can be something that makes the app performance and functionality a bit more clumsy/flaky on those devices. As said, we haven’t experienced any issues so far and I think this is the most best option for people running significant number of iOS devices in their test labs and device farms.
Use Image Recognition to Spot the Notifications
This is probably the second best option you have for avoiding OS upgrade notifications on iOS. You basically need to have a script in place for your test automation that goes – or starts your test case – through iOS device screen and tries to find certain UI elements about pop-up notification. When found, perform on click on those. However, this is not a bullet-proof always for few reasons:
There are different types of notifications – For example, you can’t use ‘Remind Me Later’ or ‘Cancel’ types of UI elements as graphics assets to find whether UI pop-up notification is shown on the screen. There are many other things – and some can be even app-related – that show up these notifications. With iOS notifications there are typically two different buttons to select activity for approving and getting rid of that notification – “Yes” and “No”.
There are too many details of notifications – Let’s say you try to look for upgrade notification based on graphics, but instead that 9.2.1 you’ll be asked to upgrade to 9.3 Beta 4 (or something else). This basically means you can’t inject the entire pop-up screen for your image recognition test script, but you need to give it ‘less’ graphics to identify whether it asks you the right question.
In case you want to implement image recognition to get rid of OS level notification or just learn how image recognition can get rid of notifications check out that blog!
Implement Appium Script to Take Care of Notification Pop-Ups
Especially on iOS test automation, automating clicks on OS notifications and other dialogs have been quite problematic. Luckily, some of the frameworks are developed to include this sort of feature to enable more seamless test automation and ensure that test scripts will run smoothly across devices. To solve this problem, you can use a desired capability specifically designed to handle these notifications:
capabilities.SetCapability("autoAcceptAlerts", true); capabilities.SetCapability("autoDismissAlerts", true);
Or alternatively, you might want to try to click on all alerts:
The down-side of these implementations is that it doesn’t work bullet-proof on all types of notifications. In addition, some of those notification pop-ups can show up at random order and basically any time of the execution so the script must be either created so that it can intervene any time of the execution OR execution will halt and only this piece of script will be executed. Not the most convenient way and it will surely spoil that test run session.
If you are interested to learn how Appium could potentially tackle the OS notification pop-up challenge, check it out from this blog series.
Happy Test Automation Folks!
Learn all the basics about Appium, how to set it up and how to use it for mobile app testing.Download