This pre-GA (Generally Available) feature is accessible only to a select set of customers. The full GA of this feature will soon be made available.
You can use CSV files to drive API Monitoring tests by data stored in the CSV file. This is useful for testing various input combinations using a single test to increase test coverage of your API.
This article covers the following tasks:
Prepare Your CSV Data File
The data file can support the file extension .csv, .txt, or .dat, with a file size or no more than 5 MB.
Set your variables
Use the header row to define your variables in a list of comma-separated strings. No other separator is supported),
id,name,country
This example has 3 data columns.
Data file example
The following is an example of a variable header and corresponding data values.
id,name,country
1,John,US
2,Jack,GB
3,Mike,IN
Use CSV Data File in API Monitoring Tests
To upload and use your CSV data file:
Go to the BlazeMeter API Monitoring tab.
Open or create an API Monitoring Test.
Go to Editor > Environment > Test Settings and select Test Data.
Select Choose File, add your data file, then Upload CSV File.
Define your Run Options. You can choose to use all the data rows in the file, or set a defined number of data rows from your file.
After test data options have been set, your test data headers will be visible in Editor > Steps.
You can now add parameters using the test data variables in your Request and Assertions sections, much like regular variables. For more information, see Use Variables to Pass Data Between Steps (Chained Requests).
Run Your Data-driven Test
After uploading and configuring your CSV data file, and adding parameters to your step Request or Assertions, click Run Now.
Tip: Enabling the "Run Once" option allows you to run a particular step only in the first iteration. For example, this can be useful if your first step is authentication and you only need to authenticate the first iteration, while all subsequent requests will be automatically authenticated.
After enabling, click Save and Run.
View Test Iterations and Individual Data Line Results
For data-driven tests, test results will be grouped in Iterations. Each iteration represents a test execution using a single data line entry from the CSV file.
Each set of Iterations will show a failed count (if any). This represents the number of individual iterations that failed within that group.
Access individual data line result
To view an individual iteration/data line result:
Go into a test and select Results.
Click on View Iterations to show the individual iterations.
Identify the specific iteration by clicking View Test Data.
This will bring up the data line from that particular iteration, as follows:
Tip: Clicking View Test Data next to the test name in the Iterations view will show all the data lines used in all the iterations.
Once you've identified the iteration, click View result.
The individual data line result is shown:
0 Comments