How to upload multiple files for a BlazeMeter test using a single upload file API command

book

Article ID: 197149

calendar_today

Updated On:

Products

BlazeMeter

Issue/Introduction

Is it possible to upload all the files from a subdirectory to a BlazeMeter Test using a single test file upload API command?

curl "https://a.support.blazemeter.net/api/v4/tests/<testId>/files" -X POST -F '[email protected]<pathname to file>' --user '<id:secret>'

 

Environment

Release : SAAS

Component : BLAZEMETER PERFORMANCE TESTING

Resolution

 

Unfortunately, the test file upload/update API only allows the specification of the name of a single file as documented on the Upload or Update Asset Files API reference page.  However, it is possible to zip up a number of files in a single zip archive and upload that file to the test.  When BlazeMeter executes the test, it will unzip the contents of the zip archive on the engines configured for the test prior to running the test.

You cannot include the file that the test is configured to run in the zip archive, so at most, you will have to upload 2 files to a test through the API - the test file itself and the zip archive that contains all of the other files required for your test to run in BlazeMeter.

Note that the zip file cannot be larger than 50M, the file naming conventions apply to the name of the zip file as well as the files contained in the zip file, and none of the files (other than jar files) contained in the zip file can contain non-ascii characters.  These restrictions can also be found on the API reference page.