Blog

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
Article by a1qa
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.

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

Cons:
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

Why do bugs get missed
27 September 2024,
by a1qa
7 min read
Why do bugs get missed? Learn the problems and tips to avoid them
Still, finding overlooked bugs after the app goes live? Let’s find out why this happens and how to fix it.
Performance testing
QA consulting
Quality assurance
Test automation
QA to ensure smooth migration to the cloud
15 August 2024,
by a1qa
3 min read
QA to ensure smooth migration to the cloud
Learn how effectively migrate to the cloud by implementing QA activities.
Functional testing
General
Migration testing
Performance testing
Quality assurance
Test automation
Load testing
23 July 2024,
by a1qa
3 min read
7 reasons why businesses need load testing 
Want to optimize software performance or ensure its smooth functioning during peak sales season? Discover how load testing may help.
Quality assurance
Test automation
Shift-right testing
9 July 2024,
by a1qa
5 min read
Embracing shift-right testing to enhance software quality through real-world insights
Let’s reveal the power of shift-right testing for ensuring high software quality.
General
Test automation
2 July 2024,
by a1qa
6 min read
Interview with Mike Urbanovich: How to build a robust test automation strategy?
The Head of testing department at a1qa answers the questions on how to smartly build a winning test automation strategy and talks about the advantages you may obtain with it.
Interviews
Test automation
27 June 2024,
by a1qa
3 min read
Establishing seamless interaction between development and QA teams to boost productivity
Establishing seamless interaction between development and QA teams to boost productivity
Agile
General
Quality assurance
Test automation
17 June 2024,
by a1qa
5 min read
Shifting to test automation to maximize software quality
Explore in the article why businesses should move from manual testing to test automation.
Quality assurance
Test automation
RPA in QA
28 May 2024,
by a1qa
4 min read
Embracing robotic process automation to drive efficiency in QA
Discover how the convergence of robotic process automation helps reshape software testing practices.
General
Quality assurance
Test automation
Shift-left testing for better software performance
25 April 2024,
by a1qa
4 min read
Optimizing software performance with shift-left testing
Still in doubt whether to include performance testing from the initial development stages? Learn the benefits companies obtain with shift-left performance testing.
Performance testing
QA consulting
Quality assurance
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.