When parameterizing test cases with different variable values, you can Load Test Data from Spreadsheets, Generate Synthetic Test Data, Find Test Data from TDM Database Models, or any combination of these sources.
When should you choose which option?
- If your test data is a list of fixed values, the best solution is to collect this data in spreadsheet columns and attach the CSV file to the test.
- If you need dynamic test data, generate it synthetically. Generated test data looks like real or random data, but you have full control over its form, and you don't have to collect it yourself. You generate data using Test Data Generator Functions.
- Synthetic test data is advantageous in tests where you need dynamic parameter values, such as relative date stamps ("today" or "last month"), fake but valid credit card numbers, random but human-readable names, and so on.
- BlazeMeter additionally helps you avoid invalid values: The included test data generator functions don't generate dates such as February 31, names such as asdf%as'df, nor credit card numbers with invalid checksums.
- If you use the TDM product and its Find & Reserve feature, BlazeMeter offers TDM integration to access your TDM database models to load test data.
How to Insert Test Data?
If you are using the debugger, click Stop to close the debugger before defining new test data.
- Open a GUI Functional Test and go to the Configuration tab of the scenario.
- Click Test Data.
The list of data parameters opens on the right side.
- Click the Plus sign and create a parameter. To initialize the parameter, choose one of the following procedures:
- Click Copy Parameter Name to Clipboard.
- Return to the scenario editor and edit the appropriate test step.
- Replace the static value with the pasted parameter.
When you run the test now, BlazeMeter generates test data for the variable based on the provided function, and sets the parameter values in the test definition to the generated test data.
How to Manage Parameter Values?
In the Test Data window, hover the mouse over a parameter definition to show the editor buttons.
The four buttons have the following functionalities, from left to right:
- Copy Parameter Name to Clipboard so you can paste it easily into a test action in the scenario editor.
- Preview one instance of generated data. Click again to toggle back to the function view.
- Edit this parameter definition to change the parameter name, the function, or its arguments.
- Delete this parameter. If the deleted parameter is in use in a scenario step, the step will break.
Available Data Generator Functions
Synthetic Data Generator Functions work in the same way as advanced functions that you may be familiar with from Excel spreadsheets, such as DAYS() or CHOOSE().
The following functions are available:
|Text Functions||generate new random strings, change the capitalization of a string, or tell you the length of a string.|
|List Functions||let you pick a random value from a list, or a substring from a string.|
|Identifier Functions||generate random but valid credit card numbers and globally unique identifiers.|
|Date and Time Functions||let you identify the day of the week or the name of the month, generate random dates and times, or generate dates and times within ranges.|
|Mathematical Functions||let you perform common mathematical operation (such as add, multiply, divide, modulo), convert bases, or generate random numbers.|
|Logical Functions||let you compare values and generate data according to custom conditions.|
For more detailed information about how to use functions, see Test Data Generator Functions.