Object Files
Object files are used when tests include uploading binary data such as pictures and videos.
Upload object files in the Errthquake portal on the Test Assets page.
File Formats
All file formats are accepted. Errthquake treats object files as binary files and inserts them into HTTP requests as delimited multipart sections of the request body.
Referencing Object Files in Tests
Reference object files by prefixing the filename with an @ character. Using the filename without an @ character will result in the filename text being used in the HTTP request instead.
Currently the object filename is also the filename used in the HTTP request created for the command. However, any parameter name can be paired with a file value.
Hard Coded Object File
Commands:
upload:
Url: https://api.myservice.com/content/
Method: PUT
BodyParams:
file: "@CoverArt.jpg"
The example includes uploading a file named CoverArt.jpg.
CSV Input Identifying the Object File
user1,password1,abbeyroad,The Beatles,Abbey Road,AbbeyRoadAlbumCover.jpg,42.58
Commands:
upload:
Url: https://api.myservice.com/content/
Method: PUT
BodyParams:
cover: "@{$6}"
This example expands the {$6} input to upload a file named AbbeyRoadAlbumCover.jpg.