Previous versions supported two types of sources variables used for parameterization: Extractors and Datasets. v2.8 added 2 more sources variables types: Data Generators and Functions:
1. Data Generators (DG). A Data Generator returns a random value that can be used to parameterize requests. DG can be used for creating streams of emulated business data which can be included into the HTTP load stream. It allows to more realistically mimic physical users interacting with web application by entering real-world business data.
DG appear on the navigation menu under the Test Case -> Source Variable node as another type of variables. The following data types are supported: Integer, Double, Date/Time, GUID and Text.
To create a Data Generator (see screenshot below),
(a) Click New
(b) Select DG type
(c) Configure its properties
(d) Click the Verify button to test the return value
(e) Click Save
Data Generators are available in Ent/SP Editions.
2. Functions provide access to internal load engine variables. A function instance returns a variable of a specific type that and can be used for parameterization of requests. The returned value depends on the context where the function is called from. The function instance can be called before issuing a request or before performing an Actions (coming soon). Functions appear on the navigation menu under the Test Case -> Source Variable node as another type of variables. The following function types are currently supported:
- AgentName - a name of the current Agent.
- AgentVUNumber - the current VU number within an Agent's pool of VUs.
- TestCaseName - the current Test Case Name.
- AgentIterationNumber - the current iteration number executed by an Agent.
- URLNumber - the current URL number within a test case.
- AgentRequestNumber - the current request number issued by an Agent from the beginning of the test.
- CurrentDateTime - the current date/time.
To create a Function Instance (see screenshot below),
a) Click New
b) Select Function Type
c) Configure its properties
d) Click Save
Functions are available in Ent, SP and Pro Editions. More functions will be added based on users feedback. Your input is welcome.
3. Formatting data generator and function output. Standard .NET formatting strings are supported to format output of the Data Generators and Function. This provides a consistent, familiar, flexible, and comprehensive means of representing any of the numeric, GUID and date / time base data types as a string. To receive a desire output string, enter the necessary formatting string into the FormattingString property of a Data Generator. For example to represent long format date and time as
"25 February 2013 10:25:30", use FormatString "U"
A quick reference guide to format string in StresStimulus is provided in the post Format Specifiers
The complete reference of .NET Formatting Types is provided, for example, here http://msdn.microsoft.com/en-us/library/fbxft59x(v=vs.80).aspx
4. Using data generators and function for parameterization. Data Generators and Functions, just like Extractors and Datasets, are integrated into Parameterization Control.
To create a parameter (see screenshot below with a Data Generator example)”
a) Click on Test Case -> Parameter node
b) Select a request on test case tree
c) Select a request part by clicking on the appropriate tab
If the Parameterization Grid appears:
d) Click on “Replace with” column of the parameter row
e) In the appeared Parameterization Control select a Data Generator
If the Parameterization Editor appears:
f) select recorded value that you wish to parameterize and right-click
g) In the appeared Parameterization Control select a Data Generator
To navigate to other parts of the v2.8 release notes, click the links below: