Compatibility Test Suite (CTS): Boosting Efficiency of iOS Mobile Compatibility Testing
The Compatibility Test Suite (CTS) introduces a "one‑device operation, multi‑device linkage" approach that captures gestures on a source iPhone, maps them to other devices via element trees and image‑recognition techniques, and automates batch installation to dramatically reduce the time and effort of iOS compatibility testing.
Mobile compatibility testing efficiency has long been a pain point, especially when covering many iPhone models, iOS versions, and app builds.
For example, testing the Nuomi food channel page component on iOS requires covering 17 versions, 9 iPhone 5+ models, and 4 iOS versions, resulting in 612 manual install/uninstall cycles that are tedious and error‑prone.
Even when limiting tests to the most popular versions and devices, the human cost remains high.
What is CTS? The Compatibility Test Suite (CTS) provides a technical solution that implements "one‑device operation, multi‑device linkage" to improve testing efficiency.
Simple coordinate mapping, pure element‑tree matching, or basic template image matching are insufficient; CTS combines gesture capture, element‑tree analysis, and fallback image‑recognition to achieve reliable cross‑device mirroring.
CTS works by selecting a source device, capturing its gesture events (touch points and coordinates), locating the corresponding UI element in the source elementTree, and then using the element’s name or ID to find the matching element on other devices; if the element lacks identifiable attributes, image‑recognition methods are applied.
With both gesture type and coordinates available, CTS mirrors the event to all target devices, enabling a single action to drive multiple phones simultaneously.
Question 1: How to capture an operation event? The phone screen is mirrored to a PC, and a mouse click or drag simulates the touch, allowing the program to record the gesture and its coordinates.
Question 2: How to match the captured coordinates to a UI control? Using WebDriverAgent, the page source (including element rects) is obtained; the click’s screen coordinates are compared with the rect of each element to locate the target control.
Question 3: How to locate the same control on other phones? If the control’s name attribute exists, it can be matched directly across devices; otherwise, image‑recognition techniques are used.
Question 4: How to trigger the mirrored events? A scheduling scheme synchronises video streams between the source and a canvas, captures mouse events on the canvas, and asynchronously dispatches the corresponding touch events to each target device without blocking the main UI thread, then returns the resulting page source for the next cycle.
Question 5: How is image recognition applied? CTS employs a combination of SIFT, histogram (calcHist), and perceptual hash (pHash) algorithms to achieve robust and accurate point‑mapping across different device screens.
Step 1: Use SIFT local features to locate target points quickly and accurately, tolerant to scaling and rotation.
Step 2: When SIFT fails, fall back to rect + calcHist, comparing RGB histograms of control images for 100 % accuracy at a modest speed cost.
Step 3: For rare bad cases, apply rect + pHash to match structural information of local images.
Question 6: How to save repeated install/uninstall time? CTS wraps the ios-deploy tool with batch commands, enabling one‑click bulk installation and removal of IPA packages on multiple iPhones.
# 1. Detect current connections
idevice_id -l # 2. Batch install IPA
ios-deploy -b [IPA_PATH] -i [UDID] # 3. Batch uninstall
ios-deploy -u --bundle_id [BUNDLE_ID] -i [UDID]Typical compatibility testing steps include preparation, execution, and result comparison; CTS currently automates preparation (batch install/uninstall) and execution (one‑device operation, multi‑device linkage). Future work will focus on automating result comparison, bug detection, and root‑cause analysis.
Author Introduction
Jin‑Xin Xiang – responsible for Baidu Nuomi vertical and merchant testing technology improvements, specializing in iOS automation testing.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
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.
