---
title: "【自动化测试】Airtest&Poco架构与底层原理剖析"
author: "Perrin Yong"
author_profile: https://www.pystone.net/profile/
published_by: "Perrin Yong"
canonical: https://www.pystone.net/notes/airtest-poco-architecture-internals/
type: note
content_role: unspecified
visibility: public
id_stability: rename-stable
source_path: "10-计算机、信息技术与工程/03-软件工程与质量保障/CI-CD与质量保障/CI-CD工具链/【自动化测试】Airtest&Poco架构与底层原理剖析.md"
content_hash: ce25a7a32f424c39a05ec3a3e6235c59c561e9171b046440f6969f84d4905f13
knowledge_version: 224c990773de.5fa8af6e39fa
site_commit: 224c990773de166d23a886306577dd90379529ce
notes_commit: 5fa8af6e39fa3891d1b9b4832bfa6c4e0ecaaf0a
---
# 【自动化测试】Airtest&Poco架构与底层原理剖析

> 创建时间：2021/5/28 18:32

  * 【自动化测试】Airtest&Poco架构与底层原理剖析
    * Airtest
      * Architecture View
    * Poco
      * Architecture View
      * Python In depth
        * Poco instance
        * UI proxy object
        * Poco SDK
          * SDK interfaces
          * SDK std
      * Unity3D SDK

## Airtest

### Architecture View

```cpp
string s = String.Empty;

```

## Poco

### Architecture View

```cpp
string s = String.Empty;

```

### Python In depth

#### Poco instance

#### UI proxy object

#### Poco SDK

AbstractDumper - Dumper class is introduced to get the hierarchy information and convert it into serializable data.

AbstractNode - AbstractNode is a wrapper class that **provides UI hierarchy and node info** in game engine. This class uniformly specifies **node-related methods** such as retrieving the attributes or accessing the parent nodes or their children.

Attributor - This is a helper class to access the node attributes.

DefaultMatcher - for poco hierarchy traversing. Including **logical query condition** and **predicate expression**. When traversing through the hierarchy tree, matcher will apply the match method on each node of the tree.

Selector - Selector is used for selecting the specific UI element(s) by given query expression (formal definitions are in specific implementation classes).

> class Selector - implements the standard Selector interface that uses DFS algorithm to travers through tree-like hierarchy structure.

Exceptions - provides several exceptions for poco-sdk

##### SDK interfaces

This package (poco.sdk.interfaces) defines the **main standards for communication interfaces** between **poco and poco-sdk**.
If poco-sdk is integrated with an app running on another host or in different language, then poco-sdk is called **remote runtime**.

The implementation of these interfaces can be done either remotely or locally depending on your own choice. If it is done locally, refer to **poco.freezeui** for more information.

Poco needs to communicate with the app runtime under the convention of interfaces described below and these interfaces must be properly implemented. Any object implementing the same interface is replaceable and the communication protocol or transport layer has no limitation. Furthermore, in many cases the communication can be customized that one part of interfaces can use HTTP protocol and other can use TCP.

command - This interface defines command-level behaviours providing abilities to control remote runtime by sending self-defined command.

hierarchy - This interface defines hierarchy-related behaviour assembling from **IDumper** , **Attributor** and **Selector**.

**input** \- This interface ensures the ability for simulated input on target device.

**screen** \- ensures the ability for accessing the rendering the results presented on screen of target device.

##### SDK std

**std.protocol module** \- <https://poco.readthedocs.io/zh_CN/latest/source/poco.sdk.std.protocol.html>

**std.rpc package**
rpc.controller
rpc.reactor

**std.transport package**

### Unity3D SDK
