File Downloads
Understand how to automate file downloads in REST API testing by making GET requests, saving JSON response bodies as files, and validating their content and existence. This lesson guides you through practical steps using Rest Assured and TestNG for effective test automation.
We'll cover the following...
We'll cover the following...
What is file download?
There are instances where we need to save the response body message as a file. In this example, we will make a GET request that returns a JSON string which will be saved as a file.
Example: Download JSON file
- HTTP method: GET
- Target URL:
http://ezifyautomationlabs.com:6565 - Resource path:
/educative-rest/students
Take a look at the code below:
The output of this code returns the following ...