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 data 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 GUI Functional Test debugger, click Stop to close the debugger before defining new test data.
- Open a Test and go to the Configuration tab.
- 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 test configuration and edit the appropriate test step.
- Replace the static value with the pasted parameter.
Example: In a GUI Functional Test, paste the parameter as a value in a Scriptless scenario.
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.