Using Test Data in GUI Functional Tests
Your goal is to replace hard-coded parameter values in test steps with dynamic test data. For example, you replace the static address that you typed in during the recording by the parameter ${address}; and then provide dynamic address data for that value. You can use one or combine multiple of these data sources in a test, CSV files or synthetic data, as needed.
Define Test Data Parameters
A Data Entity is a container for Data Parameters. A Data Parameter is a dynamic value such as a date, name, address, credit card number, that you want to use in a test instead of hard-coded values. You reference these values in test steps as ${date}
, ${name}
, ${address}, ${creditcardnumber}
, and so on.
- Go to the BlazeMeter Functional tab and open a GUI Functional Test configuration.
- Click Test Data. The Test Data pane opens on the right side.
- Click the Plus button to add one or more Data Entities.
See the respective specific article for details:
For example, you can choose to generate a synthetic value for the parameter ${address}, or to read static address values from a CSV spreadsheet, and so on.
Use Data in GUI Functional Tests
After you have loaded or defined test data, you use it in your test. For more information, see How to Use Test Data.
- Go to the BlazeMeter Functional tab and open your GUI Functional Test configuration that has test data parameters defined.
- Open the Test Data pane, go to each data parameter, and click Copy parameter name to clipboard.
- Return to the test steps and replace hard-coded values by pasting the copied parameter name.
Define Iteration Settings for GUI Functional Tests
When attaching test data, the number of rows in the CSV files determines the number of test iterations that will be executed. But in a GUI Functional test's configuration, you can also manually control how many rows of data are used, by opening the Test Data pane and clicking Iterations.
For more information about Run Options, see How to Control the Number of Rows Used - Test Data Iteration Settings.
Preview Test Data
Previewing your test data is helpful when you are combining data from multiple files, or generating synthetic test data, so you can review values in context.
- Open a GUI Functional Test with test data attached.
- Verify that at least one data parameter is defined to be able to generate the data preview.
- Click Test Data, Iterations.
The Test Iteration Settings window opens and shows the data preview.
Manage Test Data
Open a GUI Functional Test and click Test Data to open the Test Data pane. Each GUI Functional test can currently have one data entity attached, which can contain a mix of CSV files and synthetic Test Parameters.
Any team member can save their data entity to the Workspace to share it, and load saved entities into their tests. For more information about managing shared test data, see How to Share Test Data and How to Use Test Data.