Mobile test automation with Appium

What should you consider when planning to automate your mobile testing? Check it out in the article. 
15 January 2018
Mobile app testing
Test automation
The article by a1qa

Test automation isn’t a new topic discussed by the software development and testing community. However, mobile test automation is a relatively fresh trend. And the demand for the service is continuously growing. Mainly, it is attributed to the fact that mobile apps get more functionality and adopt the role of the desktop PC.

However, the attempt to get the market share first doesn’t always allow for timely testing. Manual testers don’t manage to run all regression tests as fast as needed. And this is where automation comes to help.

Benefits of mobile test automation

The main benefits of automated testing for mobile apps coincide with those typical of web apps testing:

  • Automated tests run faster than the manual ones
  • No human errors
  • Opportunity to perform simultaneous testing across various devices
  • Coverage of multiple localizations

The advantages are significant, yet the drawbacks are also worth consideration:

  • Once the operating system is updated, automated tests will stop functioning until the framework is also updated.
  • It takes more time to develop a test automation script for mobile apps. Compare: one script for web apps takes 8 hours, while for mobile an engineer will have to spend about 20 hours.
  • Many mobile test automation tools lack stability.
  • UI components differ from one mobile platform to another. Due to the overall variety, it’s very difficult to come up with a single tool that will go well with all kinds of UI. It’s either technically impossible or the development will cost too much and bring the benefit from automation to nothing.
  • Special requirement to iOS: all .ipa files should be signed with a development identity.

Choosing the right approach and tools for automation

When it comes to development test automation scripts for web apps, there are very few questions arise. Selenium WebDriver is highly-adopted open-source framework appreciated by all professional QA teams.

However, with mobile apps the situation is a bit different and the choice isn’t that obvious.

The main question, by the way, isn’t related to tools selection, but to the approach. The selected approach will predefine the tools and the automation process.
Generally, there are two techniques to automate mobile apps testing:

  • Record and Play
  • Screen Object-Mapping

Record and Play used to be very popular in the early days. The software records and logs all actions performed by the manual tester, including every mouse movement, clicks, and screenshots, and develops the code that will test the app.

Pros: fast implementation, no knowledge in programming is required
Cons: the test scripts can not be tweaked and as soon as the app is changed, the script should be re-recorded

Another technique is UI elements mapping. The approach is commonly known as Screen Object-Mapping.

All UI elements are treated as an object class, and the identifier for this class is stored in the object map.

The approach works as follows. The test script contains the logical name for the object. When the automation engine of the test framework reads the test data (login and password), it picks up the logical name of the object, select the class identifier from the object map, calls the wrapper function for the object class “Login page,” and performs the required action.

The code is reusable
The test script is reliable and isn’t sensitive to app changes
Easy-to-understand logic

Programming knowledge is required
Time-consuming development of scripts

We recommend to implement the second approach to provide thorough testing of the software. If you in-house team lacks the knowledge, consider hiring the third-party QA vendors to perform automation.

When you’ve selected the approach, it’s time to consider the available tools and choose the right one.

There is a great number of test automation frameworks. In the picture below you can see the most popular of them. Pay attention that some of them are language-specific (Xamarin for C# apps only). Some of them may appear to be too costly (Ranorex, for example).

test automation frameworks for mobile apps

That’s why it’s very important to weigh all pros and cons of the process and of the tool before making a sensible decision.

The a1qa team recommends paying attention to the Appium framework.

Appium — best choice for mobile automation for iOS and Android

Appium is a free open-source test automation tool for native, hybrid and mobile web apps, tested on simulators (iOS, FirefoxOS), emulators (Android), and real devices.

One of the key advantages of Appium is the support for different scripting languages: Java, Ruby, Python, C#, PHP.

Before getting down to work with Appium, it’s necessary to set up the environment composed of the following elements:

QA team to perform mobile test automation.

Let us elaborate. First of all, we install Appium Server that will map the initially generated code with various devices or emulators.

Then it’s turn to install Xcode and Android Studio with Android SDK. This will enable us to run tests on emulators, if you want to.

After defining the programming language that will be used for developing test scripts, it’s vital to install the pack of libraries. For instance, if your choice is Java language, then you’ll need Java Development Kit.

Once the software is installed, take care of the app itself. You’ll need .apk file for Android products or .ipa files for iOS. These files function as containers and make sure that the selected app can be uploaded to the necessary device.

Real devices vs emulators

Real devices or emulators? This is probably the most troublesome question for the engineers who perform testing of mobile apps. We won’t talk much about it now, as we’ve previously addressed the issue here.

The main point is that while using emulators is less expensive, it will put additional pressure on the machines thus slowing down testing.

Also, the results delivered by testing on emulators are not always valid. It’s not a rare case that test results on emulators are positive, while the launch on a real device is blocked and the test fails.

Considering this fact, the a1qa automation engineers run tests on real devices only.

Summing up

If you’ve decided that mobile apps test automation is what you need on your project, make sure that the chosen approach and framework will benefit to your team and project requirements. By identifying this, you’ll build solid foundation for achieving the main goal – deliver a high-quality product within the set time limits.

More Posts

29 October 2021,
by a1qa
4 min read
4 key QA activities to solve test automation challenges via AI and ML
How to address the difficulties caused by implementing test automation? Learn how to do it via applying AI and ML.
Test automation
Mobile app compatibility_mini
14 October 2021,
by a1qa
4 min read
Compatibility testing: 5 key tips to ensure high quality of mobile apps
Billions of mobile solutions and portable devices. Can you imagine that? Learn how to ensure robust software compatibility with accurate testing.
Mobile app testing
5G impact
31 May 2021,
by a1qa
4 min read
5G network impact on mobile app testing
Check out what 5G connectivity will bring to the IT world and how it will modify mobile app testing.
Cybersecurity testing
Mobile app testing
Performance testing
13 May 2021,
by a1qa
4 min read
How to attain in-sprint test automation to reinforce development processes
Learn how in-sprint test automation improves business workflows. Consider the top 5 essential steps to introduce it smoothly.
Test automation
12 April 2021,
by a1qa
5 min read
Watch out for 6 telecom trends and QA tips to implement them
In our article, we unleash the upcoming telecom trends and reveal how to be certain in introducing them correctly by applying QA practices.
Test automation
31 March 2021,
by a1qa
4 min read
QA scenario to introduce 6 eCommerce trends in 2021
Discover what trends will rule the eCommerce industry in 2021 and how QA can help implement them with confidence and ease.
Cybersecurity testing
Test automation
15 March 2021,
by a1qa
4 min read
Mobile app performance testing: getting high software efficiency
Explore 3 cornerstones of mobile app performance testing and QA steps on how to execute it successfully.
Mobile app testing
Performance testing
25 February 2021,
by a1qa
4 min read
9 QA points for delivering high-quality SaaS-based solutions
In the article, we’ve gathered 9 QA factors relying on the SaaS specifics that may help to perform SaaS testing with ease.
Cloud-based testing
Cybersecurity testing
Functional testing
Performance testing
Test automation
29 January 2021,
by a1qa
4 min read
3 do’s and 3 don’ts in BFSI software testing
Considering BFSI to be a fast-paced industry, how to keep up with such velocity? We’ve prepared 3 do’s and 3 don’ts that help sustain the rush and high software quality.
Functional testing
Mobile app testing
Test automation

Get in touch

Please fill in the required field.
Email address seems invalid.
Please fill in the required field.
We use cookies on our website to improve its functionality and to enhance your user experience. We also use cookies for analytics. If you continue to browse this website, we will assume you agree that we can place cookies on your device. For more details, please read our Privacy and Cookies Policy.