Setting Repeats using Repeat By Property

Document created by Chris Sommerstad Employee on Jul 21, 2017Last modified by Trishala Kalal on Aug 14, 2017
Version 3Show Document
  • View in full screen mode

Repeats can be set using CloudTest properties such as the Global Property. In order to do so, one or more global properties is created before the test composition is edited. See Property for an introduction to CloudTest properties.

Setting Repeats using a Global Property List

The following example uses a global property list with two properties, Clip repeat count and Track repeat count. Refer to Create a Global Property for step-by-step instructions to create a global property list called Demo using Repeat By Property.

In the list shown on the right.

  • Clip repeat count is set to 2.
  • Track repeat count is set to 8. CloudTest uses track repeat count as a virtual user.

  1. Open the test composition to edit.

  1. Select the track.
  2. Right-click the track and then select Edit Properties.

The Properties tab appears with the track node selected in the list and its settings displayed on the right.

  1. In the General tab, click Enable Repeat, the Repeat Method drop-down select "Repeat By Property."

  1. Double click the property field (e.g. where it says [not specified]).
  2. In the Path box click the Global Property Lists node, and then select the global property list created above (for example, Demo using Repeat By Property).
  3. In the Global tab, select Track repeat count.

  1. Select the test clip.
  2. Right-click the clip and then select Edit Properties.

The Properties tab appears with the clip node selected in the list and its settings displayed on the right.

  1. Click the Repeat tab and check Enable Repeat.
  2. Select "Repeat By Property" in the Repeat Method drop-down.

  1. Double click the property field (e.g. where it says [not specified]).
  2. In the Path box click the Global Property Lists node, and then select the global property list created above (for example, Demo using Repeat By Property).
  3. In the Global tab, select Clip repeat count.

Once the repeat value is specified, save the test composition.

Play the test composition. When play is completed, the Result Details dashboard appears (unless a different default dashboard has been defined for this composition. If the dashboard doesn't display, open it, or add the Result Details widget to an existing custom dashboard.

Using the navigation tree, verify that there are the expected number of virtual users (track repeats) as well as clip repeats. For example, in the sample Global property list above, there were 8 virtual users (e.g. 8 Track repeat counts) with a Clip repeat count of 2 (e.g. the test clip played twice per virtual user).

Additional complexity can easily be built using these techniques. For example, a composition with multiple tracks, each with its own property, or several tracks controlled by a single property, among many other options.

Setting Repeats from a Message Response

A message response that returns an integer can be extracted, placed into a custom clip property, which can then be used to set the repeat count for subsequent test clips via the ""Property: Fixed"" repeat type.

For example, in the screenshot on the right, the "First Clip" executes a message whose response contains an integer, 10, which is then placed into a property. The "First Clip" is set to local scope so that its property can be accessed by elements outside it within the same track

Open the "First Clip" in the Clip Editor, click the Properties tab in the lower panel, and then use the Custom Properties tab, Plus icon to define a custom clip property to store a value. In this case, the value will be populated from a message response that contains an integer. Save the test clip after adding this property.

In the Clip Editor, populate the value of this custom property from the output (e.g. response field) by entering the custom clip property name entered above. The value can be typed, or, click the Property Chooser icon and select the custom property from the displayed properties.

In the example on the right, the Selected: Message1‘s response contains an output field, value1, from which a value is extracted and stored into the custom property called Received count.

In the Composition Editor, select the "Second Clip" and right click to select Edit Properties. In the lower panel, click the Repeat tab and then click the Repeat Type drop-down and define "Property:Fixed," using the Repeat Value field to enter the "First Clip" custom property path.

For example, {%% prop : track : First Clip/Received count %%}.

Note: For CloudTest builds earlier than 3925.34 this setting should be entered as {%% prop : First Clip/Received count %%}

Ensure that the "First Clip" has local scope set in the Composition Editor, which is a requirement for external elements to access its data. See Setting and Using Message Scope.

Play the Composition by clicking the Play icon on the Composition Editor toolbar. When play is done, inspect the Result Details widget. Click Navigation Tree to show the hierarchy of composition elements. Note that in the shot on the right the "Second Clip" shows up 10 times.

With "First Clip" selected, click the Events List tab. The response value for value1 should match the total number of clip repeats for the "Second Clip" as shown above.

Attachments

    Outcomes