- Created by SS Doc Editor on Sep 09, 2021
Variables are used to reference various types of dynamic data for parameterizing simulated requests. Each variable is evaluated during the test run before issuing a request, where the variable is used for parameterization.
StresStimulus supports four types of variables provided below:
Variable Type | Data Source | Use in Parameters |
---|---|---|
Extractor | Server-Based | {{extractor_name}} |
Dataset | Predefined | {{dataset.field$databinding_method}} |
Data Generator | Generated on-the-fly | {{data_generator_name}} |
Function | Generated on-the-fly | {{function_name}} |
External | Provided in your custom code | {{variable_name}} |
Each variable is stored in the test script as a software object of a specific type that has an appropriate set of properties. When you create a variable in StresStimulus UI, an appropriate property grid will be presented. After the variable is created, almost all of its property can be changed through the same property grid. You can also edit variables' properties using the script editor.
When creating a variable, you do not need to worry about specifying its data type. When a variable is populated with external data, StresStimulus automatically converts external data into the readable text format if necessary, using the appropriate decoding method. For example, if a variable is populated with data extracted from a WCF binary server response, then binary data will be automatically converted to XML before populating the variable.
Variable expressions
A variable expression is a combination of plain text and variables used to create an expression. Expressions can be used in parameters and object properties that accept expressions.
For example:
The expression user_{{int_data_gen}} this will return the string that is a concatenation of "user_" and integer returned from a data generator named int_data_gen.
- No labels