Data files

This topic describes the advantages of using data files and how to use them.

Use data files

You can upload data files and assign them to scripts so that the scripts can use their contents instead of having to input the data directly into the scripts. This is especially useful when multiple scripts use the same data (for example, paths, URLs or credentials). When the data changes, you only need to update and reload the data files, instead of having to manually update multiple scripts.

Data files associated with a script are deployed on load generator machines at runtime and extracted into the script's folder.

The folder structure inside the data file is maintained, but existing files in the script folder are overwritten.

Data files are not exclusively for data or parameter files. You can also use them to share common items, such as header files, code, and TruClient function libraries.

Assume you have a common login implementation defined in “login.h” which is used by multiple scripts. You can create a .zip file to include the “login.h” (and its dependencies), and upload it as a data file to LoadRunner Cloud. Then, associate it with all scripts which need the implementation. Should you choose to include a shared transaction in your data files, all the scripts that need to use this transaction must include a reference to it.

If you want to update the common login implementation, you create a new .zip file to include the updated implementation, then reload the data file in Assets > Data files as described below.

All scripts associated with the data file automatically use the new implementation.

Back to top

Prepare data files

The following guidelines apply to data files:

  • Data files must be uploaded as a .zip file.

  • The size of a data file, both compressed and decompressed, is limited (see Data file limitations). To optimize the test initialization process, we recommend that you avoid using large files.

  • For trial versions of LoadRunner Cloud, the total of all .zip files cannot exceed 200 MB.

  • The maximum number of data files that can be uploaded per tenant is 100 for trial versions and 5,000 for non-trial versions.

  • By default, the following file types are supported: dat, csv, txt, xml, json, cfg, pdf, doc, docx, xls, xlsx, h, c, java, jar, js, yml, yaml, zip

Back to top

Organize data files in a Git repository

You can connect to an existing Git script repository and add data files to your LoadRunner Cloud assets. For details, see Git integration.

Each data file in a Git repository is a folder. To identify these data file folders, add a configuration file called data.yml in the repository. In the data.yml file, you must include a type member with the value lrc-data-files. In addition, you can include the name and relative path of directories that contain data file folders. The Git agent searches the directory containing the data.yml file, as well as any other directory referenced in the data.yml file, and identifies every folder in these directories as a data file.

For example:

The data.yml file only includes the lrc-data-files type member and the directory that contains the data.yml file also contains a data file folder.

data.yml file content Structure in Git repository Structure in LoadRunner Cloud

The data.yml file includes the lrc-data-files type member as well as the names and relative paths of other directories that contain data file folders.

data.yml file content Structure in Git repository Structure in LoadRunner Cloud

Back to top

Upload and manage data files

To upload and manage data files, select Assets > Data Files.

Data files that have been uploaded are displayed in a list. For each data file in the list, the number of scripts to which the data file has been assigned is also displayed. For a selected data file, additional information is shown on the right, including the files that comprise the .zip file and the scripts to which the data file has been assigned. In addition, for Git data files, information about the Git agent and repository is displayed and you can also click the Commit history link to view the last ten commits.

Action How to
Upload
  1. Click .

  2. Select Upload.

    Note: This step is only required if you are connected to a Git repository.

  3. Select the data files to upload

  4. Click Open.

Upload from Git

Note: This action is only available if you are connected to a Git repository. For details, see Git integration.

  1. Click .

  2. Select Upload from Git.

  3. In the Add data file from Git dialog box, select the agent, repository, and branch that connect to the Git repository you want to use.

  4. Select the data files to upload and click Add.

Reload
  1. Click .

  2. Select Reload.

  3. Note: This step is only required if you are connected to a Git repository.

  4. Select the data files to reload.

  5. Click Open.

Reload from Git

Note: This action is only available if you are connected to a Git repository. For details, see Git integration.

  1. Click .

  2. Select Reload from Git.

  3. In the Reload data file from Git dialog box, select the agent, repository, and branch that connect to the Git repository you want to use.

  4. Select the data files to reload and click Reload.

Sync

Note: This action is only available for data files in a Git repository.

  1. Select the Git data files you want to sync.

  2. Click to sync the data files with the Git repository.

Download

Select the data file in the list and click .

The file is saved in the default Downloads directory in the local file system.

Delete

Select the data file in the list and click .

Deleting a data file removes it from any assigned scripts and also from the current project.

Back to top

Assign data files to scripts

You assign one or more data files to a script through the Assets > Scripts or via the Load tests > Load profile pane.

For details, see Assign data files.

Back to top