When testing APIs, it is often necessary to change parameter values and execute requests multiple times. So, how can you loop requests with different data sets in Postman? In this article, we'll introduce you to the methods for doing so.
Why Loop Requests with Different Parameter Values?
When testing APIs, there are often situations where you need to change parameter values and execute requests multiple times or loop requests with different data sets. The reasons for this include:
- Validating Input Values
APIs can receive various input values. By testing edge cases such as abnormal values and boundary values, you can verify the appropriate handling of API input values. - Testing Different Use Cases
APIs may support multiple use cases. By using different parameter values, you can test whether each use case is handled appropriately. - Verifying Complex Conditions
If the API processing logic is complex, a single parameter value may not be sufficient for testing. Changing the combination of parameters allows you to verify behavior under more complex conditions. - Validating Response Validity
Changing parameter values allows you to verify whether various responses (normal and abnormal) are returned appropriately from the API. - Abnormal Testing
By intentionally sending invalid parameter values, you can test whether the API's abnormal processing and error handling functions properly. - Performance Testing
By sending a large number of requests or large payloads, you can test the performance of the API.
In other words, API testing requires comprehensive verification of whether the API functions appropriately under various conditions by changing parameters, thereby improving API quality and reliability.
What is Postman?
Postman is a popular tool for API (Application Programming Interface) development and testing. With Postman, developers can create HTTP requests and send them to API endpoints, allowing them to test API behavior and inspect request and response data.

Postman also provides a feature-rich interface for creating and editing requests, managing headers, setting parameters, and inspecting responses.
How to Change Parameter Values and Loop Requests for Multiple Times in Postman
When testing APIs, you may want to execute the same request multiple times with different parameter values. How can you achieve this in Postman? Here's how:
Create Test Data
If you want to loop a request with different parameter values, you first need to create test data that includes all the parameter values. For example, as shown in the following image, create a JSON file called UserName.json and include five user names in this file.

Use Variables in the Request
Next, use variables in the request. Here, the field names in the JSON data automatically become variable names, so you can use the test data in the request settings by referencing it as {{username}}
.

Use Test Data in Collection Runner
Then, right-click on the collection containing this request and select "Run Collection" to execute the collection. In the collection runner screen, click "Data" -> "Select File" and import the JSON file you created earlier.

After importing the JSON data, you can click the "Preview" button to review the contents of the test data.

Run the Collection and Review the Results
If there are no issues with the test data, click the "Run XXXXXX" button below to execute the collection. When running the collection, you can review the execution results. In this case, since the GET request references the {{username}}
variable, the result shows that all the field values from the test data are added one by one to the GET request, and the request is looped multiple times.

So, if you want to change parameter values and loop requests multiple times in Postman, it's convenient to use Postman's test data feature.
Loop Requests More Conveniently with Apidog's Data Sets
If you want to execute requests with different parameter values more conveniently than Postman, Apidog is an excellent option. By using Apidog's data set feature, you can more easily change parameter values and loop requests.
Apidog provides a comprehensive API solution. You can freely use features like API design, documentation, test automation, and mock servers in Apidog. Here's how to change parameters and loop requests multiple times using Apidog's data set feature.
Step 1: Open Apidog and click "Automated Testing" from the right-side menu in your API project. You can create a test scenario and add test steps. You can reference saved APIs, and API Cases, or create new requests.

Step 2: Select "Test Data" from the top menu, and you can create data sets for testing through an intuitive UI, which is very convenient.
Step 3: After editing the test data, return to the automated testing screen and select the data set under "Test Data." Here, the number of iterations is automatically calculated based on the defined data set count.


Step 4: Click on the request in the test step and define parameter values as variable names as needed.

Step 5: Run the test scenario. A "Select Test Data" window will also appear, allowing you to select the data set to use for this run. After selection, the parameter values will be automatically set in sequence, and the request will be looped and executed multiple times.

Unlike Postman's collections, Apidog's test scenarios have no limitations, and you can add all APIs, API Cases, and custom requests as test steps. This feature allows for more flexible API test automation. Additionally, when using data sets for testing, Apidog allows you to either create test data through an intuitive UI or import existing files, providing a more convenient and flexible solution.

Conclusion
On the other hand, Apidog's data set feature makes it easier to change parameter values and loop requests. With Apidog, you can create and manage test data through an intuitive UI, providing high flexibility and convenience. Additionally, Apidog provides a comprehensive API solution, supporting the entire API lifecycle, including API design, documentation, test automation, and mock servers. It is a tool that can help improve API quality in general, not just API test automation.
Looping requests by changing parameter values is an essential function in API testing. Postman and Apidog offer different methods to provide this functionality, allowing users to choose based on their needs.
The ability to change parameter values and loop requests is crucial for API testing. It enables input value validation, testing different use cases, verifying complex conditions, validating response validity, abnormal testing, and performance testing. Postman and Apidog each provide different methods to achieve this functionality, allowing users to choose the tool that best suits their needs.