52.9.4 Parallel Activities

All scripts so far have been written for a single device engaged in one activity at a time. However, a script can also control the activities of multiple devices, or assign multiple parallel activities to the same device.

52.9.4.1. Example 1: CS Voice/Video – Caller and Receiver

For example, if one phone is to place a voice or video call to another, caller and receiver must be put in parallel, one dialing and the other answering. To create a branching structure for these concurrent tasks, we use the "Parallel" activity from the Control Flow category. See the screenshot below, where EQ1 calls EQ2:

A parallel structure is also recommended for MMS send/receive.

52.9.4.2. Example 2: Concurrent Activities on Different Devices

Next is a slightly more complicated example. Suppose that we want to control three UEs in parallel, one performing downloads over FTP and the other two looping short voice calls. For this purpose we need to build a somewhat more complicated workflow, as detailed in this section.

First add a "While" activity and set it to run 10 times. This will become an outer loop repeating the various activities that will be included in it.

Remove "sequenceActivity1" by selecting it and pressing Delete. (The Sequence activity is created automatically, but in this case we do not need it at the topmost level – compare the steps that follow.)

Drop a "Parallel" activity inside the while loop.

Since the Parallel construct by default provides only two branches, we need to add one more. To this end, right-click the "parallelActivity1" box and choose Add Branch from the context menu. The structure is now expanded with a third branch:

It is now time to define the service-related activities. Let us begin with the voice calls:

Add while loops to branches 2 and 3 and set each to execute 5 times.

Add a voice call snippet (a predefined one is found in the Activity pane) to each while loop. Set the wait time to 10 seconds.

To assign the activities to the correct devices, we need to change the equipment (EQ) parameter to EQ2 and EQ3 in branch 2 and branch 3 respectively. This is done in the Properties pane or from the context menu for each activity.

After these steps, branches 2 and 3 of the workflow should have the following structure:

Next, define the FTP task for device no. 1. All you need to do here is to add an FTP download snippet to branch 1 and associate it with a functional configuration.

In the screenshot that follows, the voice sequences have been collapsed to make the overall structure of the workflow clearer.

This script will conduct a total of 10 FTP downloads and 2x5x10 = 100 voice calls.
See section "Parallel" for full details on the Parallel activity.

Note: When composing a script for multiple concurrent data service sessions using multiple devices, it is wise to make sure that these sessions are not all initiated simultaneously. It is better to let the sessions start one at a time, allowing at least a few seconds between successive initiations. Insert Wait activities as appropriate to achieve this. (No such Waits are present in the above example, which contains only one data service session.)

52.9.4.3. Example 3: Concurrent Activities on the Same Device

The Parallel structure can also be used to run multiple activities concurrently on the same device, even multiple activities of the same type, provided that the device supports it. The activities concerned are those for FTP download/upload, HTTP, email, and Ping.
The script shown below lets one device perform two concurrent FTP downloads. All instances of the FTP Download activity use the same configuration set; however, to prevent file write conflicts, each activity adds a unique prefix to the target file name (refer to section "FTP Download" for details).

When assigning multiple scanning activities to the same device, it is best not to start all of the scans at the exact same time. Insert short waits as appropriate to stagger the start times, as exemplified in the following screenshot (branch 1: no Wait; branch 2: Wait with duration 2 s; branch 3: Wait with duration 4 s). Compare the similar advice in section "Example 2: Concurrent Activities on Different Devices".