Note

This document is only a supplement of Poco framework and AirtestIDE editor, please visit Poco Project Document for more information.

Poco

Poco Quick Start

Poco is cross-engine UI automation framework that provides engine independent powerful APIs to retrieve the UI element hierarchy. Poco supports mainstream game engines such as Unity3D, Cocos2dx, native Android apps etc.

Unlike Airtest, which is based on image recognition, Poco can use code like poco("OK").click() to get and control elements of the UI hierarchy.

https://poco-chinese.readthedocs.io/zh_CN/latest/_images/overview1.gif

Supported Platforms

On most platforms, Poco needs to be implemented to Poco-SDK first , or it won’t function properly. But on a few platforms (like native Android APP), Poco can be used directly. Currently, the supported platforms are:

We are working on the support of more platforms. To request support of other platforms, please submit an issue via Poco-github or contact us.

Tutorials and Examples

Please be sure to check the Poco project document - Tutorials and examples to learn the basic methods of selecting control elements and how to operate on them.

Get Started

If you use local Python environment and want to develop Poco scripts just like regular Python, please refer to the related chapters in Poco Quick Start document. Import poco in .py files to start using Poco. Poco scripts can be developed by any text editor or Python editor. Use PocoHierarchyViewer to get the attributes to control the elements.

However, in AirtestIDE there are simpler functions for getting Poco control elements and scripting. Follow these steps to get started quickly:

  • Refer to the supported platforms above and implement your game/app with Poco-SDK.
  • When you switch Poco application type, a notice box to insert code to initialize Poco will pop up in script edit box. Click ‘Yes’ to insert the related Poco initialization code in the current script.
  • Start writing Poco scripts.

Steps as shown below:

../_images/4-poco_manual_record1.gif

Poco assistance window in AirtestIDE

In AirtestIDE, there are many functions that are convenient for writing Poco scripts. For example, after clicking the record button in Poco assistance window, Poco statements will be automatically generated according to current operation:

http://airtest.netease.com/tutorial/gif/poco_auto_record.gif

But the auto-generated statements may not be satisfying. Usually, we need to write some more complicate statements as well as statements that select the UI control elements more precisely. In AirtestIDE, with the pause function, we can freeze the current UI tree structure to inspect the UI control elements precisely. Double clicking the nodes on the UI tree automatically inserts Poco statements, which can be adjusted more precisely to further improve the readability and running success rate of the scripts:

http://airtest.netease.com/tutorial/gif/poco_manual_record.gif

For a detailed use tutorial, please refer to Performing automation testing with Poco

DEMO

Considering the steps for implementing the SDK are quite complicated, we offer several simple Demo examples on different platforms for you to download and familiarize with Poco. Please visit Poco Examples and Tutorials for more details.

More Questions

Visit our Github page AirtestProject to check our open source Poco, Poco-SDK and PocoUnit project.

If there are more problems, you’re welcome to submit issues to help us improve the project.

Poco reference

Complete documentation is available on http://poco.readthedocs.io/en/latest/

PocoSDK reference http://poco.readthedocs.io/en/latest/source/poco.sdk.html

PocoSDK intergration guide http://poco.readthedocs.io/en/latest/source/doc/integration.html

Poco APIs http://poco.readthedocs.io/en/latest/source/poco.pocofw.html

Provides basic APIs for Poco instance such as performing user actions (click, freeze, take screenshot, swipe, etc.)

Poco proxy APIs http://poco.readthedocs.io/en/latest/source/poco.proxy.html

Provides UI proxy APIs for UI elements on the target device such as getting and setting the UI element attributes, info about nodes, if UI element exists or not, info about UI element position and also the user input simulation such as click, drag, focus, etc.

Poco Exceptions http://poco.readthedocs.io/en/latest/source/poco.exceptions.html

Poco defines several exceptions for specific error handling. This document provides an overview of how to use these exceptions.

Poco supported engines http://poco.readthedocs.io/en/latest/source/doc/poco_drivers.html

Provides overview of how to use Poco for different engines.

Examples and tutorials http://poco.readthedocs.io/en/latest/source/doc/poco-example/index.html