Parameter Replacement Methods

Parameter Replacement Methods

LegiTest ›› Tutorials ›› Using Parameters ››
Parent Previous Next

Parameter Replacement Methods


Elements, Assets and Assertions within LegiTest can use parameters in one of three replacement methods


  Direct Property Replacement: Users can map a parameter to a property within the test suite / group

  Parameter Token Replacement: Users can insert tokens within a property value. When using this method, LegiTest interprets these as a parameter.


{{ParameterName}}


  Environment Variable Replacement: Users can insert system environment variables within a property value. When using this method, LegiTest interprets these as environment variables.


%EnvironmentVariableName%


At test execution, LegiTest replaces all parameters with the supplied value. This parameter replacement occurs regardless of the method used. For examples of the parameter replacement methods in use, please see the Parameter Tutorial.


Important Note

Direct Property Replacement is the only method of mapping a parameter to a value that is not a string.


Formatting Parameters


Sometimes it is necessary to format our parameters. For example, consider the SQL Query:


SELECT * FROM [MyTable] WHERE [LastModifiedDate] >= '{{ProcessingDate}}'


In this example, we would like the parameter to be formatted as four digits for the year, two for the month and two for the day. We can use filters that are defined by the DotLiquid markup to format the parameters as we would like:


SELECT * FROM [MyTable] WHERE [LastModifiedDate] >= '{{ProcessingDate | date:"yyyyMMdd"}}'


A reference of the available filters can be found on the DotLiquid for Designers page.