Currently, data entities are supported in jMeter- and Taurus-based Performance Tests. The Test Data pane is only visible after you have uploaded or recorded a test script.
As with all test types, you have the following options to provide test data to a Performance test:
- Provide static test data in a spreadsheet in CSV format. Each column contains data for one parameter. The first row can contain column names.
For more information, see How to Load Test Data from Spreadsheets. - Generate test data dynamically: Use BlazeMeter's built-in functions to generate synthetic parameters, such as dates, addresses, names, random numbers or random text, and more.
For more information, see How to Generate Synthetic Test Data. - Users of CA Test Data Manager (TDM) can additionally connect to a TDM server and load their F&R Models as test data.
For more information, see Find Test Data (TDM Find & Reserve Model Integration)
You can use one or combine multiple of these data entities in a test, as needed. For more information, see What are Data Entities and Data Parameters? and How to Use Test Data.
This article covers the following tasks:
- How Do I Reference CSV Files?
- Use data in performance tests
- Manage Your Test Data
- Define Test Data Parameters
- Preview Test Data
How Do I Reference CSV Files?
Before uploading your test scripts and configuration, make sure to prepare them by referencing CSV files with relative paths, as described in this article.
You can create data entities in BlazeMeter or upload CSV files. When you create a data entity, BlazeMeter creates a corresponding CSV file that you can reference from your script.
Attached data entities and their paths are listed in the Test Configuration next to the JMX file. The data file names and their contents are also included in the report log.
Data Source | Relative Path |
A data entity created in BlazeMeter named "My test data" | "My_test_data.csv" |
A CSV file my_test_data.csv uploaded to BlazeMeter and attached to a test | "my_test_data.csv" |
A CSV file our_test_data.csv that you have uploaded to BlazeMeter's Shared Folder our_shared_folder | "our_shared_folder/our_test_data.csv" |
Use data in Performance Tests
You can start by adding a data entity in BlazeMeter, and later edit the JMeter file to use it. Or you can upload existing JMX and CSV files together, and expand the data entity in BlazeMeter later. Or you can record a JMeter test using the Chrome Recorder Extension, and add data entities and CSV files later.
- Go to the BlazeMeter Performance tab.
- Open a Performance Test.
- Click Test Data and click the Ellipsis button to add a data entity.
- Click the small plus button to add one or more data parameters to the data entity. For more information in data parameters, see How to Use Test Data.
- Download the data entity as a CSV file.
Prepare the Test Configuration File
BlazeMeter uses the first row of data as parameter names to refer to columns in the CSV file. If the first row does not contain column names, provide a comma-separated list of variable names in the test configuration file, as described here:
(JMX Script only:)
Open the JMX script in JMeter and verify the following fields in the "CSV Data Set Configuration".
- File Name:
Provide the relative file path of the attached file.
Example: File Name: mydata.csv - Variable names:
If the first row contains column headings, leave this option empty. If the first row contains data, define column name mappings here; to skip a column in the mapping, add an extra comma with no name.
Example: Variable names: lastname,firstname,,street,number,,
(Taurus Script only:)
Open the Taurus script in a text editor and verify the following fields in the data-sources section:
- - path:
Provide the relative file path of the attached file.
Example: - path: mydata.csv - - variable-names:
If the first row contains column headings, leave this option empty. If the first row contains data, define column name mappings here; to skip a column in the mapping, add an extra comma with no name.
Example: - variable-names: lastname,firstname,,street,number,,
Example:
The file "mydata.csv" has six columns and no column headings. You want to reference address data in column 1, 2, 4, and 5, and ignore column 3 and 6. Therefor you declare the following variable names:
lastname,firstname,,street,number,,
In a test script, you will be able to reference the values of column 1 as ${lastname}, column 2 as ${firstname}, column 4 as ${street}, and so on.
For more information about the test configuration file, see Using CSV DATA SET CONFIG and CSV file upload.
Upload the Test Script to BlazeMeter
- Log on to BlazeMeter and go to the Performance tab.
- Upload the prepared JMeter or Taurus file.
- Click Test Data to open the Test Data panel.
- If the script references unresolved CSV files, upload the listed missing files now.
- Click the small plus button in each data entity to add test data to it.
- Make sure to create and define all parameters that are used in your script.
Tip: Manage your test data by replacing static values by synthetic test data as needed.
Manage Your Test Data
Each performance test can have multiple data entities attached. As a rule of thumb, if you have data that you need to maintain or use separately, create separate data entities. Any team member can save test data to the Workspace to share it, and load saved data entities into their tests.
For example, create separate data entities for mutually exclusive geography-dependent test data, or for static versus synthetic test data, or for team members who use different subsets of the same test data.
For more information see How to Share Test Data.
Define Test Data Parameters
A test data parameter is a value such as a date, name, address, credit card number, that you want to use in a test. You reference these values in tests as ${date}, ${name}, ${creditcardnumber}, and so on.
Test data can be read from an attached CSV file, but also synthetically generated, or loaded from a TDM F&R Model. For more information, see How to Use Test Data.
Define Data Settings for Performance Tests
To edit data settings, edit parameters in the test configuration file directly. When attaching test data, the number of rows in the CSV files determines the number of test iterations that will be executed.
In a Performance test's configuration, open the Test Data panel and click Data Settings.
Run Options
- For more information and examples of Run Options that you can set in BlazeMeter, see How to Control the Number of Rows Used - Test Data Iteration Settings.
Target Options
The following options are loaded read-only from the configuration for your reference. To edit these options, edit the test configuration file.
- Delimiter — Indicates the column delimiter that your configuration files uses for CSV data, for example "\t" for the tab character. The default delimiter is a comma.
- Ignore First Line — Indicates whether BlazeMeter will treat the first row of data as column headers (true), or as data (false).
- Allow Quoted Data — Indicates whether your configuration allows quoted values because your column values can contain commas, and you also use commas as delimiters.
Example: If a value can be "123 Main street, Springfield", allow the tool to surround the data by double quotes, otherwise the cell will be split into two columns.
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 Performance 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, Data Settings.
The Test Data Settings window opens and shows the data preview.
0 Comments