Mobile app testing automation with Xamarin

Earning the trust of a cautious client

A mobile app to facilitate sales

Our client, a 1.5 billion manufacturer of non-durable goods, has a large, national team of field sales representatives who visit retail, business, and academic customers in urban and very remote areas. Their customer base varies in size and scope, from city hospitals to rural feed stores, and in-field internet access can be slow or unavailable.

The client wanted to allow sales reps to perform enhanced in-field customer planning, inventory review, and ordering. To do this with maximum results they needed a marketing and sales app with a web based application for manipulating the backend (admin) site.

App requirements:

  • User perspective: easy and intuitive for sales to use; facilitate easy, effective customer engagement; pivot with a constantly evolving sales and marketing space; facilitate positive revenue results
  • Native: App had to feel “native” to its users, incorporating critical native APIs for field sales reps such as iOS Maps
  • Versions: App needed to support different iOS versions (especially iOS 9-10) and multiple Apple Air devices
  • Back-end: Data needed to be synced back to network; aligned with Azure database and APIs

Based upon app requirements above, an internal environment that included a team skilled in .NET and C#, along with time and budget priorities, the client chose Xamarin.Forms with a specific platform (iOS) for mobile development, along with manual testing and automation testing using Xamarin.UITest.

Testing: thanks but no thanks

Integrant was called in about one year into the enterprise app dev process, when the client recognized they needed to augment their internal team with some Xamarin development support. The client worked in an agile environment including daily standups and 2-3 week sprints. We engaged with the client on the development side at sprint 31. At that time, the client didn’t believe they needed testing support. We were tasked with helping on the development side only.

With respect to testing, the client had started building the general architecture for a test automation framework, and had written some initial test scripts, but were still engaged only in manual testing. The client had one developer who owned the test automation framework including writing test methods. Though the intent was for him to get up to speed quickly, and Xamarin is designed to facilitate a fast learning curve, it still requires a time commitment that can be challenging for a project under tight deadline.

Our team members are hired based upon their interest in looking beyond immediate client requests, toward next-level preparations, e.g., how will this system respond to future changes, additions, requirements, updates; how can dev and test time be made faster, easier, and more effective? In this situation, given our experience with both test automation frameworks in general and Xamarin Test Cloud in particular, we believed we could serve the client beyond app development.

We felt we could refine existing test automation methods and make writing code easier; and that we could prevent issues from occurring with the app when functionality was changed down the road, including sync operations and data downloads.

To address the need we identified, Integrant assigned an SQE to explore an optimized testing automation framework (on Integrant’s time and dime). Our SQE became a “shadow” member of the Integrant dev team. He looked at the automated framework already underway, building an isolated framework to which he could add enhancements. From here our SQE restructured what the client had already built. He applied the latest framework and versions of Xamarin Test Cloud and Xamarin.UITest while making enhancements, changes, refactoring, restructuring existing code, refining functions, manipulating common functions and data entry, and adding other features to make it easier to build and write automated test scripts.

Using 3-4 test cases, our SQE prepared a PoC for the client to demonstrate our knowledge of Xamarin UITest and Xamarin Test Cloud by way of the enhanced framework. The live demo included basic functionality and navigation and covered how to:

  • Build a clean test automation framework
  • Arrange existing functionality
  • Handle common functions
  • Enter and sort data
  • Manipulate running of test cases
  • Identify screen behaviors shown to users
  • Handle existing code
  • Add new code in an easy way

We serve people, not projects!

The test automation framework PoC was met with strong, positive client feedback on the management level. But we still needed to earn the trust of the internal testing team. The internal team appreciated that 1. our enhancements leveraged their existing framework, and 2. our priority was serving them according to their protocols and preferences. As a result, our SQE quickly (within a matter of two days) was given access to the client’s framework, code, functionality, and sprints.

We were taught and followed their processes surrounding how to write test cases, which tasks to start with and close with, and all related hierarchy. From there we made small changes, merging with their local branch to be part of the existing test automation they had on their framework. We completed the test automation framework enhancements within one week.

Our SQE was asked to join the internal team on manual testing, writing test cases, and writing automated test scripts. Integrant is now merged with the client’s in-house team on current and future projects specific to testing.


Prior to our test automation value exploration, testing was done on a tactical level specific to a current dev task, e.g., “Let’s do this test now and push it now.” There was little opportunity for planning for future needs in terms of extending, refining or refactoring existing test cases. Today it is easy for the internal team to remove or edit existing test methods.

Our client now maintains a library of 50-100 test methods written by our SQE and reflecting our input on how to structure and folder test cases; approach main functionality, setup, and methods for test scripts; and deal with calculations and assertions. Going forward we will work together to restructure test suites based upon future needs, targets, and Xamarin versions.

The testing portion of the Integrant team includes one SQE who integrates with the client team of 2.5 quality people (2 fully allocated, 1 half allocated). Our SQE is the lead quality person for the client and mentors the client on Xamarin Test Cloud and writing automation test scripts and structuring the framework using Xamarin.UITest.

In terms of our aggregate partnership including both dev and test, we have achieved a mutual level of trust where some scrum master tasks as well as other leadership tasks are assigned to the Integrant technical project lead.

Where else can we help? /br It’s not only about delivery, but also extended help and support

We recently updated the Xamarin.Forms version in order to leverage new features like AutomationID. The AutomationID property sets an identifier in Xamarin.Forms that enables UITest code to reference controls. The result is ease in dealing with screen elements and manipulating functionality. We also worked with the internal team to configure the test cloud environment around daily running of automation.

Our dev team has begun working on a web-based admin site for the front end Xamarin mobile application development. The site supports back-end operations like manipulation of sales and marketing materials. The dev team is using HTML, JavaScript, and Angular to support multiple browsers including Chrome, IE, and Safari.

Our test team is involved as well. Currently we are preparing a PoC for the client in support of a test automation framework for this back-end web application. The client has asked us to help them determine the best testing framework to use for the web application. We are preparing two PoCs, one for Selenium and another for Protractor. The PoC will demonstrate the capability of each framework to extend automation to reach coverage level of the web admin tool.

Trust is earned

The client required that we earn their trust and our belief is that if trust must be earned it is worth the investment. We are proud to work alongside the internal dev and test team of this committed, integrity-driven client as they serve a customer base that is extraordinary in size, scope, and loyalty.