Selecting a Value for a Condition

When adding conditional logic to a visual test, use the Select the Condition dialog box to select a value or to create a literal value for a condition in the Condition Designer.

Select a (Literal) – Select this option to display the following literal option:
  • Literal data – Enter either a text string, a number, or a boolean (true or false) value, and then click OK.

  1. In the Define a condition area of the Condition Designer, click ... to the right of the value text box that you want to populate.

    The Select the Condition dialog box opens.

  2. Select the type of the value:
    • Click Property to select a property of a control.
    • Click Variable to select a variable.
    • Click ActiveData to select an active data asset.
    • Click Literal to create a new literal value, which can be a string, a number, or a boolean value.
    • Click Exists to select a verification of whether a specified control exists.
  3. If you have selected Property, perform the following actions:
    1. Expand the Identify a Control menu and select one of the following:
      • Application Under Test – Click this button to identify a visible list or combo box control from your test application.
      • Screen Preview – Click this button to identify a list or combo box control directly from the Screen Preview, if the application under test is not available.
      • Identify Object Dialog – Click this button to use the Identify Object dialog box to identify a list or combo box control. The Identify Object dialog box additionally enables you to edit the locator of the control.
    2. After identifying a control, select the desired property from the Properties list.
  4. If you have selected Variable, perform the following actions:
    1. Select the variable type from the Variable type list or click New to create a new variable. The following variable types are available:
      • Local – Select this to use a local variable, which is a variable that is typically defined and used within a single visual test, and which usually stores the values of other types of variables, for example global or passed-in variables.
      • Input Parameters – Select this to use a parameter that is passed in to the visual test.
      • Output Parameters – Select this to use a parameter that is passed out by the visual test.
      • Reserved – Select this to use a predefined variable, which stores information about the playback and the results of the visual test.
    2. Select the desired variable from the Variables list.
  5. If you have selected ActiveData, perform the following actions:
    1. Expand the Select menu to the right of the ActiveData asset text box.
    2. To create a new active data asset, click New ActiveData. For additional information, see Creating a New Data File for ActiveData Testing.
    3. To associate an existing active data asset, click Associate existing ActiveData. For additional information, see Mapping Data in an ActiveData File to Data in a Visual Test.
    4. After you have specified the active data asset, select the column that you want to use from the Columns list.
  6. If you have selected Literal, type the string, number, or boolean into the Literal data text box.
  7. If you have selected Exists, perform the following actions:
    1. Expand the Identify a control menu and select one of the following:
      • Application Under Test – Click this button to identify a visible control directly from the application under test.
      • Screen Preview – Click this button to identify a control directly from the Screen Preview, if the application under test is not available.
      • Identify Object Dialog – Click this button to use the Identify Object dialog box to identify a non-visible control. The Identify Object dialog box additionally enables you to edit the locator of the control.
    2. Select Control exists to verify that the control exists.
    3. Select Control does not exist to verify that the control does not exist.
    4. Type a value into the Timeout field to specify how long Silk Test Workbench should wait for the control to appear or to disappear. The default timeout is 0, which means Silk Test Workbench does not wait for the control to appear or to disappear.
  8. Click OK.