Automatically Testing File Uploads (multipart/form-data) with Postman and Gitlab CI
If you are wondering how to automate your manual file upload testing process — look no further. I will guide you through the process step by step.
File upload from Postman
If you don’t know Postman, it is a software development and testing tool for working with APIs. If you are new to Postman, don’t worry. I have prepared a video introduction to Postman that will help you get started in only 25 minutes.
Assuming that you are already familiar with Postman, let’s see how we can do a file upload using Postman.
Open a new tab, select the POST HTTP verb and paste the following in the address field:
httpbin.org/post
httpbin.org is a simple REST service that is simple to use and good for learning how HTTP works. Before you start solving more complex issues, it is always a good idea to get to the basics and understand how things work.
Next, go to the Body
part of the request and select form-data. Hover over the first field where it says Key
and from the drop-down box that appears select File. This will allow you to select and upload a file.