File Uploads

If the application includes an operation involving the upload of a file from the users computer to the server, it may be desirable to provide different files during a simulation. Configuration to simulate the upload of different data files during a load test is broken down into three steps:

  1. Import the data files you would like to use during a load test into Load Tester.
  2. Create a dataset of filenames specifying the specific files that will be used for the load test.
  3. Create a modifier to have the Virtual User replace the recorded file content with one of the selected files during playback.

Importing files

A predefined set of files must be imported into Load Tester through the File Uploads preferences page. This page may be accessed from the menu: Window » Preferences » Web Performance » File Uploads .

Screen Shot of File Upload Preferences

Once on the File Upload page, you may select the "Add file(s)" button to select files for Load Tester to keep available for use during a load test. Each file will be copied into a private location from which they may be synchronized with any remote load engines in use prior to a load test. If a file is changed after adding it, the "Add file(s)" button may be used to replace the copy used for load testing with the updated copy.

Creating a Dataset

The simplest way to create a dataset is from the same File Uploads preferences page described above. By selecting the "Generate Dataset" button, Load Tester will offer to create a dataset of all the files currently available using the repository and names specified.

Alternatively, if the intended load profile consists of different test cases where some files may be used in one test case and not another, then it may be necessary to customize a dataset to specify the subset of files that should be used. Please see Create a new dataset for more information.

Creating a Modifier

Once files have been successfully imported and a dataset prepared, we will be ready to proceed to the Fields View to locate a file upload to be updated.

Screen Shot of File Upload selected in Fields View

Editing a file upload field is similar to editing other fields. The first step will be to configure the value, which contains the file contents. To use the files configured above for the content of the file upload, choose a File upload datasource. You will then have the opportunity to choose a source for the name of the file to use as the content. By default Load Tester will select a Dataset source, which is the most common method. Then choose the dataset and field that contains the filenames:

 

Screen Shot of Edit File Upload Modifier Dialog

 

When editing the modifier of a file upload field, the Field Editor dialog will show a Filename part, in addition to the name and value parts. The Filename part of the field can be used to configured to change the name of the file sent to the server, if required. This may be the same dataset field as specified above if just the name of the file (excluding the path name) is sufficient, or an alternate dataset field containing a complete file name may be used. In many cases, the server will completely ignore the filename sent - in these cases the Filename part can be left as a recorded datasource.