The topic describes the advantages of using data files and how to use them.
Using 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, credentials, and so forth). 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 will be deployed on load generator machines at runtime and extracted into the script's folder.
The folder structure inside the data file will be maintained, but existing files in the script folder will be 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.
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 will automatically use the new implementation.
The following guidelines apply to data files:
- Data files must be uploaded as a .zip file.
- By default, a single .zip file cannot exceed 50 MB. If your .zip file is larger than 50 MBs, try removing some of the non-essential and extraneous files in order to reduce the file size. If you still need LoadRunner Cloud to accommodate a larger data file, open a support ticket.
- 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
Select Assets > Data Files.
Data files that have been uploaded are displayed in a list that includes the number of scripts to which a data file has been assigned. 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.
Click Upload, select the file, and click Open.
Click Reload, select the file, and click Open.
Select the data file in the list and click Download.
The file is saved in the default Downloads directory in the local file system.
Select the data file in the list and click Delete.
Deleting a data file removes it from any assigned scripts and also from the current project.
You assign one or more data files to a script through the Assets > Scripts or via the Load Tests > Scripts pane. For details, see Assign data files.