You can use the online recording feature to install apps on remote devices, record steps, and generate test scripts from a web-based interface.
A test case library is created and associated with a specified app. For more information, see Create a test case library.
Install an app
Log on to the Mobile Testing console.
In the left-side navigation pane, choose Testing Management > Test Case. The Scripts tab appears.
Select a test case library and a test case library version from the Case Library drop-down list.
Click Online Recording. The Online Recording panel appears.
In the Online Recording panel, perform the following operations:
Select Sharing Device.
Specify Brand, System Version, and Resolution to filter recording devices.
Select a recording device from the device list.
Click OK. The Select App dialog box appears.Note
Devices in the In Use state cannot be selected.
In the Select App dialog box, select or upload an app.
Select an app. Select the app that you want to install and click Install in the Operation column to install the app on the recording device.
Upload an app. Click Upload Test App to upload an app. For more information about how to upload an app, see Upload an app.
After the app is installed, the system automatically goes to the Online Recording page. The online recording usage duration is displayed in the upper-left corner of the page. The usage duration starts from when you enter the remote debugging page.Note
In the left-side remote device pane, view the values of the Remaining Free Trial Period and Remaining Resource Plan Period parameters.
On the left side of the online recording page, the remote device on which the app is installed is displayed. For more information, see Remote device description.
To exit the online recording, click Exit.
Create a script
1. On the Online Recording page, perform one of the following operations based on your business requirements:
Click Create Script. In the Create Script panel, configure the parameters to create a script. The recorded steps are saved to the new script.
Click Select Existing Script. In the Select Script panel, select an existing script. The recorded steps are saved to the specified script to overwrite the original steps.Note
You must configure the script that you want to select in advance. For more information, see Create a script.
In this example, Create Script is used.
2. In the Create Script panel, configure the parameters.
The following table describes the parameters that are used to create a script.
Test Case Library Version
The version number of the test case library.
You must create a test case library version in advance. For more information, see Create a test case library version.
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 storage path of the script.
The description of the script. The description facilitates subsequent query and review.
3. Click OK. The editor for the created script appears on the right side of the Online Recording page.
For more information, see Script editor description.
1. On the Online Recording page, click Record and select Record by Control or Record by Coordinate to record the script.
The following recording methods are supported: Record by Control and Record by Coordinate. We recommend that you select Record by Control.
2. On the remote device, click the app to simulate taps on the screen. Then, the steps are recorded and generated on the Script Steps tab.
A long period of time is required to start an app or load a page, and steps can be recorded only after page controls are fully loaded. If an app startup or a page redirect is involved in the recording, we recommend that you add the Wait step.
3. (Optional) In the script editing toolbar, click Input to configure input parameters for interaction scenarios.
4. (Optional) To improve the replay success rate, we recommend that you use the Xpath code on the Page Source tab to correct your script steps.
5. Click Stop to terminate the recording.
6. Click Replay to verify the steps.
The following items describe the possible colors of the dot before a step:
Green: The replay is successful.
Red: The replay failed.
Yellow: The step is not replayed.
7. Click Save or Save As to save the script.
8. Click Exit to exit the online recording.
After you exit the online recording, the Scripts tab appears. The recorded script is displayed in the script list. You can click the script name to view the script content.
Replay all steps. After the script is recorded, click Replay to replay all the recorded steps.
Replay a single step. In each recording step, click Play Single Step to replay the current step.
If you need to correct a recording step, you can click Insert Step in Next Row, Edit, or Remove Step corresponding to the step.
Remote device description
A remote device is used to show the basic operations that can be performed on a device.
System settings toolbar
The brand and model of the remote device.
Switches between high definition and standard definition.
Shows coordinates after you turn on Coordinates and move the pointer over the app page.
Touch screen operations toolbar
Opens a dialog box where you can enter content in fields. For example, you can enter a username or a password.
Clears the content that you specified in fields.
Restart an application
Restarts an app without clearing the cache.
Restart (Cache clearing)
Restarts an app and clears the cache.
Swipe Up, Swipe Down, Swipe Left, or Swipe Right
Swipes the screen up, down, left, or right.
Simulates three system icons of an Android mobile phone.
Drag the icon to move the system settings toolbar.
Script editor description
1: Status bar
Shows the usage duration of the online recording feature. The system starts to count the usage duration when you go to the Online Recording page.
Provides the Remaining Free Trial Period and Remaining Resource Plan Period values of the test device within the current account. The values are displayed when you move the pointer over the Help icon.
2: Save and exit
Saves the current script.
Saves an existing script as a new script.
Exits the recording page.
3: Script name
Script name drop-down list
Shows the name of the current script.
You can click the script name and select Create Script or Select Another Script from the drop-down list to use another script.
Record or Stop
Starts or stops recording steps.
Replays all steps after the recording is complete.
Refreshes all controls if the system does not identify all controls in a short period of time.
Shows logs of the Appium client and Appium server.
Clears the steps that are recorded.
Restores a step to the initial state before you start recording.
Shows the steps that are recorded.
Allows you to configure input parameters for interaction scenarios.
Provides the Xpath code that you can use to correct script steps to improve the replay success rate.
6: Interval selection switch
After you turn on the switch, you can press the Shift key to select multiple steps at a time.
After you turn off the switch, you cannot press the Shift key to select multiple steps at a time.
7: Step editing icons
Play Single Step
Plays the current step.
Insert Step in Next Row
Inserts a step after the current step.
Edits the current step.
Removes the current step.
When you move the pointer over a step, the sequence number of the step is changed to the Move icon. You can drag the Move icon to change the sequence of the step.
8: Script editing toolbar
The following table describes the categories that are provided in the script editing toolbar.
Simulates the basic operations that can be performed on devices.
Recognizes image controls by using different methods.
Adds custom code blocks, steps, or scripts.
Determines whether a control exists or whether the text meets your expectations.
Configures conditional branches in a step.
Configures loop branches in a step.
Restarts or installs an app in a step.