Skip to content

3.6 Auxiliary function of poco script recording

Reasonable use of auxiliary function of script recording can greatly improve the writing efficiency of poco scripts. There are two types of Poco recording functions currently available from AirtestIDE: single-step recording and automatic recording with accompanying operations.

1.Insert Poco initialization code

When switching the Poco application type, the script edit box will pop up a notification window prompting to insert the Poco initialization code.After confirming that the Poco application type is correct, confirm the insertion of the cursor position and click 'Yes' to insert the corresponding Poco initialization code.

Note: The Poco initialization code must be placed before the poco statement.

2.Single-step recording of Poco scripts

image

  • Generate the poco code for the UI node:
    Double-click the target entry in the UI tree to insert the poco code for the corresponding UI node.

  • Generate the x-path code for the UI node:
    On the target entry in the UI tree, click on the right-click menu - 'UI path-code' to generate the poco code for the complete parent-child chain.

Note: The Operation code(eg :".click()") in the single-step recording code needs to be added manually.

3.Automatically record Poco scripts

image

Entry mode:
Click the Poco Auto Record button.

Specific performance
- The device screen can be interacted normally, and the data of the UI rendering tree is refreshed normally.
- As the mouse moves in the picture, the UI elements of the corresponding position are marked by the marked box.
- With the device operation (click, slide), you can insert the poco code of the corresponding UI node.

Exit method
Click the Auto Record button again or Right click menu - "Poco Mode" - "Normal"