Data Profiler
The Data Profiler helps you parameterize Performance tests, Functional tests, and Service Virtualization.
One way to parameterize a test is that you manually replace hard-coded values by Data Parameters and load values from a CSV file or using synthetic data generation functions. The Automatic Data Creation Wizard speeds up the manual parts of this process for you.
The Data Profiler is available for the following test types:
- Performance tests (JMX files) that contain hard-coded values, or whose CSV Data Set Configurations are linked to a static CSV file
- Functional tests (Taurus YAML files) that contain hard-coded values
- virtual services that contain hard-coded values
What is Data Profiling?
BlazeMeter can automatically detect hard-coded values in your test scripts and replace them with dynamic Data Parameters. The advantage of dynamic test data is that you can extend it to any quantity, quality, and coverage. Feel free to run the wizard and see what it suggests; you can leave the wizard any time without making changes to your test. You can also choose to accept only a partial parameterization of a few values and keep the rest untouched. At any point you are in control: You can see which hard-coded values have been detected and how certain the type prediction is. Patterns such as common names are detected with higher certainty, while the type of anonymous numbers or unknown strings are detected with lower certainty.
-
For each hard-coded value, you choose whether you want to replace it by a dynamic parameter or keep the existing static data untouched.
-
For each data parameter, you can review the suggested generator function and preview example values.
You can edit or replace suggested generator functions right in the wizard — or manually edit it any time later, after closing the Data Profiler, in the Test Data pane.
How to Create Test Data Based on Hard-Coded Values
The Data Profiler can generate test data for tests or Virtual Service transactions that contain hard-coded values and have no test data associated yet. You can also profile attached CSV or JMX files and so on. After running the Profiler, you can choose to accept the default suggestions, customize the changes, or cancel without making any changes.
By default, based on the characteristics of the hard-coded values found, the Profiler offers to generate a suitable number of rows of synthetic data; the Profiler makes a backup of your files and replaces hard-coded values by parameters that loop over generated values. You can customize these settings and choose which values to parameterize and which not.
- Open the test or transaction.
- Click the Data Creation Wizard button next to the closed Test Data / Service Data button.
The Automatic Data Creation Wizard opens and lists the hard-coded values that it detected in your test.
-
(Optional) Choose whether you want AI Enabled for test data generation. For more information, see Test Data Pro.
- (Optional) Review the number of rows: By default, BlazeMeter generates 10 rows of test data. If you want more or fewer rows, click Change Number of Rows:
- Under Number of Rows, specify how much data you want to generate.
- (CSV file only) Choose one of the following Data Creation Options:
- By Replacing CSV
The test uses synthetic values in place of the hard-coded columns in the CSV file. The CSV file itself is not edited. - By Extending CSV
The test uses synthetic values in addition to the hard-coded columns in the CSV file. The CSV file itself is not edited.
- By Replacing CSV
Click Save.
-
(Optional) Review your file parameterization options. By default, BlazeMeter creates a data entity with data parameters and does not replace the hard-coded values
- Choose one of the following options.
- Parameterize Test and Back Up Original
- Parameterize Test Without Backup
- Don't Parameterize Test (Create Test Data Definitions only)
-
Click Save.
- Choose one of the following options.
- Verify that the detected Field Name, the Original Hard-coded Value, and its Data Type Prediction match your expectations.If the shown example is not unique for a field, click Show All Values... for more examples.
- Verify whether the Suggested Data Generator Function and its Generated Data Example match your expectations.
- (Optional) If a prediction or function is not applicable, click Change Test Data Suggestions:
- Select the checkboxes for the values that you want to replace by synthetic test data.
- (Optional) Clear the checkboxes for the hard-coded values that you want to leave untouched.
- Select a more appropriate Data Type Prediction from the menu.
A new synthetic function will be suggested.Experienced users can select the User Defined option and edit the function and its arguments inline. For more information, see Data Generator Functions. - Click Save.
- Review the Data Entity Preview.
- Click Save.
If you have chosen parameterization, the selected values in your script or in your Virtual Service Transactions, respectively, are now replaced by Data Parameters. If your data contained CSV files, BlazeMeter creates Data Entities for each CSV file. The attached CSV files themselves are not edited; BlazeMeter creates Data Parameters that override (extend or replace) columns in attached CSV files.
After you close the Automatic Data Creation wizard, you return to the Test Configuration page.
- You can change your test data any time in the Test Configuration on the Test Data pane.
- You can change your service data any time later in the Virtual Service Asset Catalog by clicking the Service Data button.
How to replace or extend a CSV file with dynamic test data?
Q: I want to add a new CSV file to a test. How do I scan its data to extend or replace columns with dynamic test data?
A: Follow these steps:
- Open the test or virtual service.
- Open the Test Data / Service Data pane.
- Click the Plus button and attach the CSV file.
A Data Entity is created. - Click the ellipsis menu of the Data Entity and select Create Data Automatically from the menu.
How to keep a copy of the original CSV file?
Q: Can I replace or extend columns in the CSV file without BlazeMeter changing the attached CSV file?
A: When you choose to replace or extend columns in a CSV file attached to your test, the actual file is not overwritten.
Dynamic Data Parameters are added to the test, and the replaced columns are merely hidden from the Data Entity editor. You can click the Ellipsis menu of the CSV file's Data Entity and select Download CSV File any time to get the original file.
How do I edit the data generation suggestions?
Q: In the Review & Select Data stage, the Data Profiler has not detected the data types that I expected. I want to parameterize this hard-coded data, but none of the suggestions are applicable. How do I suggest appropriate functions?
A: To customize the function on the Review & Select Data stage of the wizard, follow these steps:
- In the Data Type Prediction column, click the menu, scroll down, and select User Defined.
- In the Suggested Data Generator Function column, enter your custom function and arguments. For more information, see Data Generator Functions.
- Click the blue checkmark to save your custom function.
- Continue with the wizard.
What does "AI Enabled" mean?
Q: In the Automatic Data Creation Wizard, what does the AI Enabled button do?
A: Additional test data features use AI (artificial intelligence) and are available for Enterprise plans only. For more information, see Test Data Pro.
What if the Data Profiler found nothing?
Q: I ran the Data Profiler and it found no hard-coded data where I expected it. What could be the reason?
A: Verify whether one of the following situations applies to you:
-
Did you profile a Performance test JMX file that has CSV files referenced in its CSV Data Set Config or in its Random CSV Data Set Config, but you did not upload the CSV files? In this case, attach the referenced CSV files to the test and run the Data Profiler again.
-
Did you attempt to profile a Performance test, UI Functional script (YAML), or virtual service that is already parameterized?
How do I profile tests with existing test data?
Q: I already have defined partial test data in the Service Data / Test Data pane. How do I scan my test for further hard-coded data?
A: To scan a test with some test data already defined, click the top ellipsis menu inside the Service Data / Test Data pane and select Create Data Automatically from the menu. This menu is also available for individual CSV files.