Macros That Require a Special Order of Parameter Setting

Applies to TestComplete 14.90, last modified on June 15, 2021

Typically, when specifying a macro to be used by the Custom String generator, the order of specified parameters does not matter. However, there are four macros that have some requirements regarding the order of parameter setting. They are as follows:

  • Integer. This macro requires that the first numeric parameter be the value of the Minimum value parameter. The second numeric parameter must be the value of the Maximum value parameter. If you specify one more numeric parameter, it will be interpreted as the value of the Increment value parameter. In this case, the Sequence generation mode will be selected automatically.

    Here is an example of the correct usage of the Integer macro in the Value box:

    %INT(0, 100, 3)

    Remember that the values of the specified parameters must satisfy certain restrictions. For example, the minimum value must be less than or equal to the maximum value. So, the following usage of the Integer macro is incorrect:

    %INT(100, 10, 3) <-- Incorrect

  • Real. This macro requires that the first numeric parameter be the value of the Minimum value parameter. The second numeric parameter must be the value of the Maximum value parameter. The third numeric parameter must be the value of the Decimal places count parameter. If you specify one more numeric parameter, it will be interpreted as the value of the Increment value parameter. In this case, the Sequence generation mode will be selected automatically.

    Here is an example of the correct usage of the Real macro in the Value box:

    %REAL(-102.500, 102.500, 3)

    Remember that the values of the specified parameters must satisfy certain restrictions. For example, the minimum value must be less than or equal to the maximum value. The following usage of the Real macro is incorrect:

    %REAL(105.800, 102.500, 3) <-- Incorrect

  • String. This macro requires that the first numeric parameter be the value of the Minimum characters parameter. The second numeric parameter must be the value of the Maximum characters parameter. You can also specify which characters should be used to generate values. If you want to use letters in the generated strings, use the L parameter. If you want use digits, specify the D parameter. If you want use spaces, specify the S parameter. If you want use punctuation marks, specify the P parameter. You can also use any combination of these parameters. For example:

    %STR(1, 8, L, D, S, P)

    The macro generates strings that contain letters, digits, spaces and punctuation marks.

    %STR(4, L, 10, P)

    The macro generates strings that contain letters and punctuation marks.

    Remember that the values of the specified parameters must satisfy certain restrictions. For example, the Minimum characters value must be less than or equal to the Maximum characters value. The following usage of the String macro is incorrect:

    %STR(8, 3, P, L, S) <-- Incorrect

  • Value From a Set. This macro requires that the values that make up a set be specified in a certain order. For example, you can specify the following string:

    %SET(Val1, Val2, Val3, *SEQ)

    In this case, TestComplete will generate the following sequence: Val1, Val2, Val3, Val1, Val2, …. If you specify the values in a different order, the generated sequence will also be different. For example, the %SET(Val3, Val2, Val1, *SEQ) macro produces the following sequence: Val3, Val2, Val1, Val3, Val2, …

See Also

Custom String Generator
About Custom String Generator
Generators
Using Data Generators
Generate Data Dialog

Highlight search results