Considerations for Automating Mobile UI Testing
What is a successful application? Our view is, a successful application is one which responds in a functionally correct manner with the user and satisfies his (or her) need. At the same time, the application has to be simple, bug-free and easy to use. Given that the affinity towards mobile apps is growing, apps that have a killer user interface and easy usability are the ones surviving the mobile app tsunami.
This brings us to the topic of UI testing. UI testing of mobile applications tests that the user interface of the application works in the desired manner. This type of testing has to make sure that menu bars, icons, and buttons designed to make the app fun and easy to use behave correctly. Quite obviously, testing each of these aspects is a time-consuming, expensive and, sometimes even, a tedious process. This is where automation comes into play and presents an opportunity to eliminate the need to manually verify all aspects of the user interface and document all the errors noted.
Testing, any form of testing, of mobile applications, is a relatively more complex process than testing web or desktop applications. To begin with, desktop applications are usually tested against one dominant platform. In the case of mobile apps, there is no one dominant platform. Mobile apps, unless otherwise specified, have to be tested on iOS, Android (and its various versions) and now maybe Windows platforms too. Along with this, the different device form factors and device diversity make mobile app testing a far more extensive process. For example, the official Android device gallery has over 60 devices of various screen sizes, form factors, and resolutions. As mobile apps become more sophisticated the need for deeper testing increases. So just like we automate unit tests and functionality tests to ensure that the app ‘function’ like it should, we can also automate UI tests to ensure that the app ‘looks’ the way it should.
- UI validation
A mobile UI needs continuous validation during the building stage. It is essential to check size, colors, positions etc. of every single artefact on every individual view. Doing this exercise manually can be an extremely tedious process. Sometimes it can be tempting to skip the views that seem simple and have been developed a while ago and move to the most recent work that has been done. Automating the process of collecting the snapshot of the preview images becomes very helpful to discover UI mistakes and deliver greater value.
- Considerations for UI Test Automation
There are certain aspects of the UI tests that lend themselves to automation easily. However, it also has to be understood that describing tests at only the technical level can lead to brittle tests. Changes in workflows, requirement changes etc. are to be considered when writing tests for mobile applications. Considering that business rules change quite frequently as per user requirements, it makes sense to write the UI tests that are closer to the business rules and describe them with as much clarity and efficiency as possible to what has to be done.
- Selecting a UI Automation Tool
Testers have to make sure that the test automation tool that they employ tests not only the latest OS versions but also test earlier versions. For example, when testing an Android application, the test automation tool should ideally not only test the app UI for the latest Android version but test for the early versions and the sub-versions of Android. A test automation tool should allow testers to elaborate additional program modules that can be utilized during the late development cycles. Testers also have to look out for testing tools that do not have to deal with the source code to reduce the test complexity. Test automation becomes a tedious process during UI testing if testers have to write scripts for each individual device and the tests have to be adjusted each time the UI of the tested program is altered.
During UI testing testers have to make sure that the automation tool that they choose allows then to reproduce the complex sequences of user actions. Clearly selecting the right test automation tool is a great contributor to UI testing success. Using the right test automation tools will enable testers to focus on the testing system, spot defects, and regression errors to ensure that the new code does not break the current functionality, fix broken tests and adapt them to the testing system. It will so help them generate better, more detailed and informative reports and ensure that the testers spend more time in ‘testing’ and less time in setting up the tests.
Automating UI testing does require an initial investment. However, the ROI of the same is realized when the same test is applied time and again at a negligent incremental cost. When testing UI, testers, thus need to ensure that features that can change in the immediate future in terms of the UI flow, need real-time data from multiple sources, have technical challenges etc. should ideally not be considered for automation as these add to the testing costs. Being judicious about what to test, considering connectivity options and target devices, using Wi-FI networks in combination with network simulation tools work towards making automating mobile UI testing time efficient and cost effective.
All said and done, UI testing for mobile apps is challenging but it is also clear that utility exists when deploying it selectively for specific purposes.