Creating Switch

Document created by Chris Sommerstad Employee on Jul 21, 2017
Version 1Show Document
  • View in full screen mode

About Switch Containers

CloudTest supports Switch containers to control the flow of a test by the use of a property, constant, or script when working with unknown responses that fall within a known range, such as product options from a form, finite keys, or days of the week.

The example below uses three pages; AddToCart1, AddToCart2, and AddToCart3—each of which represents a different product color option for men’s slacks. Most consumers on this target site choose either Tan (40%) or Black (30%) as a product color, however, three additional colors are available for the given product. The third page submits any of the remaining colors (30%).

 

Creating a Switch in Icon View

The following steps show how to create a Switch on multiple items in Icon view, including how to define a default value.

  1. Open the clip in Icon view, identify and then select the first item on which to create a Switch.
  2. Select the clip element(s) on which to create the switch. A Switch can be created on messages, actions, and containers.
  3. Right-click and select Create a Switch from the context menu.

The Switch is created on the selection.

  1. In the Switch drop-down choose from among Property, Constant, Linked Script, or Embedded Script.

    1. Enter a value for each Case from among the possible values.

For example, where Case1: Tan, Case:2 Black, and Case3: Range (of colors).

    • For Constant, enter the constant value to switch on and then enter each Case value. The constant can be a numeric or string constant. In this example, 2 will always execute (unless it is overridden elsewhere in the clip).

    • For a Property, click the blue border where it says [not specified] to select from among existing properties, or, to create a new property. Selecting or defining a clip custom property, switchProp, results in the insertion of the property name within the blue border.

Alternately, create a new custom Switch property to use here. The example switchProp below has a hard-coded value, 2. In this example, 2 will always execute (unless it is overridden elsewhere in the clip).

      • For a Linked Script, click the Script icon to select from the Script Browser. The script must already exist at the time of selection.

After selection, the script name is inserted into the Switch line.

    • For an Embedded Script, click the Plus icon if necessary to expand the entry field and enter or paste the script.

  1. Define a Default for the Switch by selecting its container and right clicking.

The Default section is added to the Switch.

  1. To populate the Default, drag one of the clip elements into it. Alternately, add a different clip element from the toolbar or drag it from elsewhere in the clip.
 
  1. Additional Case sections can be added by clicking the green plus (+) icon on the right of the container.
  2. Click Save after making any changes.
 

Creating a Switch in List View

  1. Open the clip in List view, identify and then select the first item on which to create a Switch.
  2. Select the clip element on which to create the switch. A Switch can be created on messages, actions, and containers.

    1. Right-click and select Create a Switch from the context menu.

The Switch is created on the selection.

  1. In the Switch drop-down, choose from among Property, Constant, Linked Script, or Embedded Script.

    1. Enter a value for each Case from among the possible values.

For example, where Case1: Tan, Case:2 Black, and Case3: Range (of colors).

    1. Define a Default for the Switch by selecting its container and right clicking.

The Default section is added to the Switch.

  1. To populate the Default, drag one of the clip elements into it. Alternately, add a different clip element from the toolbar or drag it from elsewhere in the clip. The default is used if the any of the above Case values are not matched.
  2. Additional Case sections can be added by clicking the green plus (+) icon on the right of the container.
  3. Click Save after making any changes.

Switch in Result Details

Switch containers appear in the Result Details navigation tree just as other hierarchical relationships from the CloudTest object model appear.

Once the Switch is selected in the Navigation Tree (or in the Cover Flow at the top), review its Summary information on the right. Click the Events List tab to display more detail statistics about the switch.

Switch in Basic Widgets

Switch containers appear in results for all widgets that display containers.

 

Clip Element Analysis

Switch containers appear in the parent clip’s object hierarchy at the same level as other clip elements that reside at that level.

Collection Analysis

Switch are shown in the Collection Analysis chart. Using this chart in combination with renamed transactions produces a clear outline of each step in a business process.

Composition Analysis

The Composition Analysis also shows the object hierarchy, including clip elements such as Switch.

 

 

Switch in Charts

Switch are also shown in the Charts category where the given chart shows collections.

 

Bandwidth by Collection

This chart will show Switch containers as a percent of bandwidth along with any other collections.

Attachments

    Outcomes