Operations 14 min read

Distributed UI Automation Practice and Architecture

The article presents DuLab, a distributed UI‑automation platform for mobile apps that leverages Airtest, Python/Tornado, Celery, and Redis to schedule and run bulk test cases on remote devices, detailing its layered case management, package database, mock services, and the resulting scalable, efficient regression testing across diverse devices.

DeWu Technology
DeWu Technology
DeWu Technology
Distributed UI Automation Practice and Architecture

This article discusses the motivations, challenges, and benefits of UI automation for mobile applications, addressing common questions such as its value, role in testing workflows, and maintenance difficulties.

It explains why UI automation is needed: rapid version iterations increase testing workload, manual regression testing is time‑consuming and risky, and automated tests can free resources, enable continuous regression, and improve repeatability.

The advantages of UI automation are listed, including freeing test teams for exploratory testing, enabling parallel development and testing, providing fast repeatable regression, and better utilization of idle resources.

Characteristics of UI automation are outlined, emphasizing that it suits scenarios with infrequent UI changes, long product cycles, frequent regression, and reusable scripts.

Expected outcomes include compatibility testing across devices, data‑point verification, regression testing for code changes, and performance data collection during test phases.

The proposed distributed platform, named DuLab, manages remote mobile devices, executes UI test cases in bulk, and aggregates reports. The architecture consists of a server that schedules tasks and multiple workers that control devices.

A tool survey mentions Appium, Airtest, Sikuli, etc., and selects Airtest as the core framework due to its lightweight nature, script recording IDE, image‑recognition support, and Python integration.

The article explains the principles of case execution (mapping UI actions to control commands) and recording (capturing UI tree and screen stream), and introduces communication frameworks such as adb for Android, WebDriverAgent for iOS, and OpenCV for image recognition.

A table summarizes these frameworks and their descriptions.

Case management is organized into layered architecture: basic layer (common operations, utilities, installation management), business layer (page and module abstractions), case layer (grouped test suites), and framework layer (suit orchestration and reporting).

APP package management is handled via a database; the schema is shown below:

CREATE TABLE `lab_package` (
  `id` bigint(20) NOT NULL AUTO_INCREMENT,
  `version` varchar(32) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '版本号',
  `buildVersion` varchar(32) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '构建版本号',
  `bundleId` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '包ID',
  `pkgPath` varchar(255) CHARACTER SET utf8mb4 DEFAULT '' COMMENT '包存储路径,可以用来下载包体',
  `platform` varchar(255) DEFAULT NULL COMMENT '平台 ios/android',
  `timestamp` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `branch` varchar(255) DEFAULT NULL COMMENT '所属分支',
  PRIMARY KEY (`id`) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=579001 DEFAULT CHARSET=utf8;

The platform can integrate a mock service to stabilize UI states during test execution.

For distributed execution, the system uses Python with Tornado for the server, Celery for task queues, and Redis for caching and message brokering. Workers run multiple processes to control devices, manage installed packages, and synchronize case repositories via CI pipelines.

Overall, the design enables scalable, automated UI testing across many mobile devices, improving test efficiency and reliability.

pythonUI AutomationMobile TestingAirtestCeleryDistributed Testingtornado
DeWu Technology
Written by

DeWu Technology

A platform for sharing and discussing tech knowledge, guiding you toward the cloud of technology.

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.