SetAppVaribale macro at scenario level
The SetAppVariable macro is used to set the value for the application variables.
For executing the macro, the value for the Command field must be specified in this format:
SetAppVariable(Variable Name,Variable Value)
This table lists the parameters used to determine the Application Variable values to be set:
Parameter name | Description |
---|---|
Variable Name | The name of the Application Variable. |
Variable Value | The value to be assigned to the Application Variable. This value overrides the global or cycle value defined for the Application Variable for the duration of the macro execution. |
On macro execution, the Application Variable values are set and used throughout the macro and all scenario macros called from this macro through parameter variables. The value set in the SetAppVariable macro command can be used by subsequent macros within the same macro unless the parameter is specified to use an explicit value.
On completion of the macro execution, the application variable is reset to the original value using the global default/override or cycle value.
This table lists the examples of the SetAppVariable macro:
Test data | Processing details |
---|---|
Application Variable: data_source = Data_Source1 Scenario Macro = Scenario1 SetAppVariable("data_source","Data_Source2") RunCommand("%app_var_ data_source %", “reset”) |
Executes Scenario Macro Scenario1 Sets the Application Variable data_source to Data_Source2 Executes the reset command on the data source Data_Source2 |
Validations are performed when you execute the macro. If any of the validation fails, the macro is aborted, and the related error message is displayed.
This table lists the error message is displayed during the macro execution:
Parameter | Validation condition | Validation message |
---|---|---|
Variable Name | Check if the application variable exists. | Application Variable {0} cannot be found. |