Editing Local Variables For a Visual Test

You can edit local variables in the Properties pane of the <<Start>> step.

  1. Open the visual test that contains the local variables that you want to edit.
  2. Select the <<Start>> step of the visual test. Properties for the <<Start>> step display in the Properties pane.
  3. In the Properties pane, find the Variables category or double-click Variables to expand the category and display the local variables defined for the visual test. Defined variables in the Variables category include the following types:
    Visual test
    Variables that are defined in another visual test and passed to this visual test.
    Text
    The variable's value is a text string. Text type values can contain letters, numbers, spaces, and punctuation.
    Note: The text data type is case sensitive, which means the cases of the individual characters in the text string must match during comparison. If the cases do not match, the comparison fails.
    Number (Long)

    The variable's value is a number ranging from -2,147,483,648 to 2,147,483,647. Periods (for a fractional/decimal value) cannot be used.

    Number (Double)

    The variable's value is a double-precision floating-point number, and is stored as a 64-bit number in the range -1.7E308 to +1.7E-307.

    Boolean (True/False)

    The variable's value is either True or False.

    Number (Long Long)

    A 64-bit integer value that can have a value in the range -9223372036854775808 to 9223372036854775807.

    Enumeration

    This variable groups together a set of values and orders them sequentially from 1 to n. You declare an enumerated type when you want a variable to hold only a limited number of distinct values. Use this variable type with properties or variables that expect an enumeration data type.

    An enumeration stores the numeric value in a 64-bit integer in the range -9223372036854775808 to 9223372036854775807. However, the engine only supports 32-bit enumerations, while the UI supports 64-bit enumerations (in future releases, the engine will support 64-bit enumerations).

  4. Click in the value area of the variable to be edited, then click the Edit variable button in the value area. The Edit Variable dialog box opens.
  5. Type a name for the variable into the Variable name field. Valid characters for local variable names are uppercase and lowercase alphanumeric characters and the underscore ("ABC", "abc", "_"). Additionally, local variable names must be unique.
    Note: Variable names cannot begin with "st_".
    Silk Test Workbench informs you if a variable name which is being added or edited is a duplicate variable name. If this happens, you must supply a unique name for the variable being added or edited.
  6. Optional: Type an initial value for the variable into the Initial value field. The value can be changed in a visual test or script if passed to a script. The value must be consistent with type. For example, if the type is number (long), the initial value cannot contain characters that are not integers, such as text characters. For boolean variable types, select False or True from the list. Initial values are not required for variables, so this field can be left blank. The value can be determined elsewhere in a visual test.
  7. Click OK. The variable's name and initial value (if any) display under the selected variable type in the Properties pane for the <<Start>> step.
  8. Repeat the preceding step to edit other local variables as necessary. If you are editing variables to pass to a script, you must execute the script within the test for the variable values to be passed.