TARS UI Automation System: Metrics, Challenges, and Automated Case Recording Solutions
The article presents the TARS UI automation platform, analyzes its core performance indicators and the problems uncovered, and details a comprehensive redesign that introduces automatic case recording, tag generation, data mocking, smart assertions, and an upgraded cloud‑based testing infrastructure to improve coverage, accuracy, and efficiency for mobile app releases.
Introduction
In March 2020, Qunar launched the TARS UI automation system, which by the end of the year achieved its Phase‑1 goals, supporting multiple business lines, releasing over 30 versions per month, executing hundreds of automated runs, and preventing any P1/P2 incidents while saving nearly a thousand person‑days.
Core Metrics and Problems
The team identified five key metrics: coverage, intercept‑skip rate, accuracy, runtime, and bug recall rate. Continuous monitoring revealed low coverage, high skip rates, sub‑80% accuracy, long execution times, and low bug recall, each traced to high case‑writing cost, complex environment setup, and unstable test data.
Automatic Case Recording Solution
UI Automation Techniques
Two element‑location methods are discussed: image‑recognition (flexible but error‑prone) and element identifiers (precise but fragile). The team chose identifier‑based locating for reliability.
Case Writing Approach (POM)
Cases are built on the Page‑Object‑Model, encapsulating element tags and actions to reduce maintenance effort.
Automatic Tag Generation
Tags are generated from component hierarchy (business line|page|module|component|key) during compilation via plugins, ensuring uniqueness and resistance to minor DOM changes.
Automatic Tag Maintenance
When code changes, tags are diff‑matched to associate old and new identifiers, automating updates for unchanged components while flagging deleted or modified ones for manual review.
Recording QA Operations
Interactive element callbacks are wrapped with decorators to log timestamps, element tags, operation type, and code version, producing an operation list that is later translated into automation scripts.
Data Mocking
All request/response data are captured during recording; during playback, mock data replace live calls, guaranteeing stable execution despite backend changes.
Automatic Assertion Generation
Smart OCR identifies UI text within context to create reliable assertions, while key request data nodes are compared against recorded values to validate business logic.
Platform Revamp
The infrastructure was upgraded to a distributed device‑scheduling system built on STF, enabling shared mobile devices across business lines, and a cloud‑based testing platform that supports remote device rental, performance testing, and behavior tracing.
Summary and Outlook
Post‑upgrade metrics show improved coverage, reduced skip rate (<8%), accuracy above 95%, and average task runtime under 10 minutes. Future work includes IDE enhancements and AI assistance to further simplify case authoring and handle edge‑case scenarios.
Qunar Tech Salon
Qunar Tech Salon is a learning and exchange platform for Qunar engineers and industry peers. We share cutting-edge technology trends and topics, providing a free platform for mid-to-senior technical professionals to exchange and learn.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.