All Products
Search
Document Center

Mobile Testing:Create or import a script

Last Updated:Mar 15, 2022

Prerequisites

Create a script

Step 1: On the Use Cases page of the specified app, click the Scripts tab.

Step 2: Select a use case library version from the version drop-down list or use the default version.

Note

Use case library versions must be configured in advance. For more information, see Create a use case library version.

Step 3: If no data is displayed on the right side of the page, click Create Script, or click the More icon and select Create Script to open the Create Script panel.

Create Script

Step 4: In the Create Script panel, configure the script.

Create Script panel

The following table describes the parameters.

Parameter

Description

Script Name

The name of the script.

The name must be a string.

The name must be 2 to 50 characters in length.

The name can contain letters, digits, underscores (_), and hyphens (-).

The name is unique.

Script Description

The information of the script, which facilitates subsequent query and review.

Storage Directory

The directory where the script is saved.

Note

The script directory must be set in advance, or the script must be saved to Root Directory. For more information, see Create a script directory.

Script Type

The type used to set the script. Valid values:

  • Recorded Script: The test script that is generated by using the online recording feature.

  • Uploaded Script: The test script that is written by users. When Script Type is set to Uploaded Script, Uploaded Script is displayed.

Uploaded Script

When Script Type is set to Uploaded Script, select and upload script files.

Note

  • For more information about how to write a script, see Write an Android test script or Write an iOS test script.

  • The script file must be packaged as a .ZIP file. Only files of the.ZIP type are supported.

  • The script package must contain main.py files.

  • You are not allowed to edit uploaded scripts.

Step 5: Click OK to save the script.

Import a script

Step 1: On the Use Cases page of the specified app, click the Scripts tab.

Step 2: Select a use case library version from the version drop-down list or use the default version.

Note

Use case library versions must be configured in advance. For more information, see Create a use case library version.

Step 3: If no data is displayed on the right side of the page, click Import Script, or click the More icon and select Import Script to open the Import Script panel.

Import Script

Step 4: In the Import Script panel, configure the script.

Import Script

The following table describes the parameters.

Parameter

Description

Destination Directory

The directory where the imported script is saved.

Note

The script directory must be set in advance, or the script must be saved to Root Directory. For more information, see Create a script directory.

Use Case Library Version

The version of the use case library where the source script is deployed.

Select Script File

Selects the source script.

Note

You must import the directory where the source script is deployed at the same time.

Step 5: Click OK to import the source script of the specified use case library version to the specified directory of the current use case library version.

After the script is imported, the script is displayed in the left-side list based on the hierarchy tree.

Script imported