The Data Profiler helps you parameterize Performance tests, Functional tests, and Mock Services.
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
- Mock 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
This Data Profiler can generate test data for tests or Mock Service transactions that contain hard-coded values and have no test data associated yet. You can also profile attached CSV files.
- Open the test or Mock Service transaction.
- Click the Data Creation Wizard button next to the closed Test Data / Service Data button.
The Automatic Data Creation Wizard opens and informs you how many hard-coded values it has detected in your test.
- Click Next.
BlazeMeter analyzes the hard-coded values and identifies their data types.
- On the Review & Select Data screen:
- Review the Data Type Prediction for your hard-coded data.
- Verify whether the Suggested Data Generator Functions and the Generated Data Examples match your expectations.
- If the Data Type Prediction is not applicable, select a more appropriate Data Type from the menu. A new synthetic function will be suggested.
Tip: Experienced users can select User Defined and edit the function and its arguments inline. For more information, see Data Generator Functions.
- Select the checkboxes for the values that you want to replace by synthetic test data.
- Clear the checkboxes for the hard-coded values that you want to leave untouched in your script.
- If you have selected at least one value, click Next.
The Data Profiler shows you the Data Entities that it will generate for you.
- On the Data Settings screen:
- Under Number of Rows, specify how much data you want to generate. By default, BlazeMeter generates one row.
- (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
- Review examples of the data that will be generated.
- If the examples match your expectations, click Next.
- (If applicable) On the Parameterization screen:
- Choose whether and how to replace hard-coded data in your test by Data Parameters.
- Parameterize Test and Back Up Original
- Parameterize Test Without Backup
- Don't Parameterize Test (Create Test Data Definitions only)
Click Next.
- Choose whether and how to replace hard-coded data in your test by Data Parameters.
- On the Summary page, review the Data Entities that will be created.
Tip: To leave your test or Mock Service unchanged, you can click Leave Wizard any time.
- If you are satisfied, click Finish.
If you chose parameterization, the selected values in your script or in your mock 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 Mock Service Asset Catalog by clicking the Service Data button.
How to 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 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.
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 Mock 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 to edit the data generation suggestions?
Q: On 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 is the AI Enabled button in the Automatic Data Creation Wizard?
A: Certain AI (artificial intelligence)-enhanced features are available for Enterprise plans only. For more information, see I have a CSV file with examples and need more of the same type.
Troubleshooting
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 Mock Service that is already fully parameterized?
0 Comments