Defining an Expression Using the Expression Designer

Use the Expression Designer dialog box to create or edit expressions that enhance the functionality of a visual test. An expression is a combination of local variables, reserved variables, ActiveData assets, operators, and functions that return a string, number, or object. For more information, see Expression Designer.

  1. Open a visual test.
  2. From the Test Steps pane, select the test step after which you want to insert the expression.
  3. From the menu bar, choose Insert > Expression. The Expression Designer opens.
  4. From the Output list, select a local variable or ActiveData asset in which to store the result of the expression. Only local variables and ActiveData assets associated with the visual test are listed. Newly created variables and ActiveData assets are automatically associated with the visual test.
    Note: The Output list does not display when you create an expression as the value of a property in the Properties pane.
  5. Optional: Click Select next to the Output list to select an existing ActiveData asset or to create a new variable or ActiveData asset. You can select one of the following:
    • Select New Local Variable to create local variables for the visual test using the Add Variable dialog box. Any local variables created display in the Output list and can be used to store the expression result.
    • Select New ActiveData to create a new ActiveData asset and associate it with the visual test.
    • Select Associate existing ActiveData to associate an existing ActiveData asset with the visual test using the Browse for ActiveData dialog box.
    The column names of ActiveData files that are part of associated ActiveData assets also display in the Output list and can be used to store the expression result.
  6. Use the Editor window to create and edit an expression. Expressions may contain literal values, variables, ActiveData columns, operators and functions.
    1. To quickly add a variable to an expression, select the desired variable from the Select a variable (local or reserved) list, and then click Add.
    2. Optional: Click New to open the Add Local Variable dialog box, from which you can create a new variable and automatically associate the variable with the visual test.
    3. To add an ActiveData field, select the desired ActiveData field from the Select an ActiveData field list, and then click Add as and select the data type. The syntax for an ActiveData field in the Editor window is as follows:
      [Project Name].[ActiveData Name].Data Type("Column Name")
      The supported data types include:
      Text

      Data in the selected ActiveData column is used in the expression as textual data (String data type).

      Number (Long)

      Data in the selected ActiveData column is used in the expression as numeric data (Long data type).

      Number (Double)

      Data in the selected ActiveData column is used in the expression as numeric data (Double data type).

      Boolean

      Data in the selected ActiveData column is evaluated in the expression as True or False (Boolean data type).

      Number (Long Long)

      Data in the selected ActiveData column is used in the expression as a 64-bit integer value that can have a value in the range -9223372036854775808 to 9223372036854775807.

      Enumeration

      Data in the selected ActiveData column is used in the expression as a set of values and orders them sequentially from 1 to n. This data type is used by some user interfaces which require an enumeration as a parameter. For example SAP SendVKey expects an integer enumeration value for the key to be sent. An enumerated type is declared when you want an expression to hold only a limited number of distinct values. You cannot create custom enumerations for usage in visual tests.

      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. You can create a new ActiveData asset or select an existing ActiveData asset by clicking Select and choosing the desired option. The new ActiveData asset is automatically associated with the visual test.
  7. Click Test to assess the validity of the expression. The results of the test display in the Test results window.
  8. Optional: To erase the entire contents of the Editor window, click Clear.
  9. Click OK.