Skip to content

Files Manager

The Files manager tool is available on the left menu of the Design view, in the Tools section.

It lets you upload and delete files. These files can be:

  • CSV variables content,
  • POST Http request bodies,
  • scripts,
  • hosts file to be be appended at the end of the load generator’s hosts file (during validation and runtime).
  • JMeter Plugins jar files,
  • remove-files.txt: List of files to be removed from JMeter folder. This can be used to prevent compatibility issues with some library versions. The path of each file is relative to the JMeter folder. Example: lib/junit-4.12.jar,
  • before-test.sh: bash script (using #!/usr/bin/env bash shebang) to run before the test is being executed. Runs on each load generator,
  • after-test.sh: bash script (using #!/usr/bin/env bash shebang) to run after the test is being executed. Runs on each load generator.

Files Manager

Note

All relevant files will be uploaded to the load generator under a resources/ folder. Except JAR files since they must be in lib/ext/ instead. If you have any static reference to a file in your script, make sure to update it using this relative path after import. For example: resources/myCSVfile.csv.

Upload a file

You can upload files simply by drag and dropping them in the Drop files here zone or by clicking on the Choose Files button.

Files are automatically added to the list, and a progress bar is displayed to inform you the the upload progress.

Info

You can upload multiple files at the same time.

To replace a file content, simply upload the new file with the same name. The one already present in the files list is overwritten.

Delete a file

You can delete files simply by clicking on the Delete button in the list:

Warning

You can actually remove or replace a file that is used in a CSV variable or a POST request body. To make sure it does not break your virtual user execution you may run a validation before launching a real test.

Select a file

You can select or directly upload files from the CSV Variable panel or POST request bodies:

File Selector

Selecting an existing file is done using the select box. If you use many files in your project you can type the name of the file you are looking for to filter the displayed file.

Simply click on any filename to select it.

To upload a file click on the plus button located at the right of the selector. A Choose File button appears. Click on it and select a local file. It is automatically uploaded and selected.

Note

If there are no files available in the current project, only the file upload option is visible. Filters may apply for the files you can select or upload. For example CSV variable only accept .csv and .txt files.

After test script example

This script will be executed just before the test ends and all load generators are destroyed. It is a good way to execute a final action, or just save information stored on the load generators during the tests. For instance it can be used to save a CSV file created through a script to the OctoPerf report logs.

1
2
3
#!/usr/bin/env bash
mv file.csv ${HOST_NAME}.file.csv
uploadFile ${HOST_NAME}.file.csv

Here we use mv to add the load generator hostname to the file name. This way when we upload it to OctoPerf with uploadFile if there are several load generators, the file is not overwritten. It will then be available along with the JMeter logs in the report.

Warning

The after-test.sh script file will be run on a linux machine, thus it is important to use end of line chars in a linux fashion (no Carriage Return, only Line Feed). Otherwise you will end up with \r (Carriage Return) added to the commands you run, which can potentially make them fail.