Upload test data files with Newman
Newman supports file uploads so you can send test data (form data or a binary) with an API request. The data file must be located in the same working directory as the collection JSON file you are running. Also, you must include the filename in the src attribute of the request.
The following example shows the exported JSON file for a collection named file-upload. The collection has a single request that uploads a form data file named sample-file.txt in the request body.
The file sample-file.txt must be present in the same working directory as the collection. Run this collection as usual:
You’ll get a message that the file was uploaded correctly, and the test will pass.