In most cases, file data sources are used together with parameter nodes in scenarios in which custom stress testing requests are required, such as user logon simulation scenarios.
Parameter file conventions
CSV and ZIP files are supported. A ZIP compressed package can contain only one CSV file.
NoteDo not change the file extension of an XLSX file to generate a CSV file. We recommend that you use programs, such as Excel or Numbers, to save an XLSX file as a CSV file or use the Apache Commons CSV program to generate a CSV file.
The size of a parameter file cannot exceed 60 MB. Each row can contain up to 20,000 characters.
If you want to combine multiple sets of data into a set of parameters on a parameter node, you do not need to store the data in a single file. You can combine the data in multiple files into a set of parameters on the Data Source Parameters tab of the parameter node.
If you reference parameters from multiple files, you can specify a parameter as the baseline column. This way, the file that contains the parameter is used as the benchmark file. If you do not select Baseline Column or Use Once for the parameters, the system specifies a random parameter as the baseline column. For more information, see PTS read method of multi-file parameters in virtual user or RPS mode.
If parameters have mandatory one-to-one mappings, you must store the parameters in a single file and properly configure the mappings. Make sure that all columns in a row contain complete data. Otherwise, empty fields appear, which may affect the stress testing data.
The following sample code provides an example of the file content. If the data in the first row of a parameter file is not parameter names, you must specify a parameter name for each column based on your business scenario.
username,password user1,Password1 user2,Password2 user3,Password3
Import a parameter file to add a data source
Log on to the PTS console, choose , and then click PTS.
Click Data Sources. On the Files tab, click + Upload File and select an on-premises parameter file that you want to upload.
Select Use First Row as Parameter Name. After you select this option, you do not need to specify the parameter names. The data in the first row is used as the parameter names. When PTS reads the parameter file, PTS ignores the data in the first row. If the data in the first row of the parameter file is not parameter names, you must specify a parameter name for each column based on your business scenario.
Click Save.
Add a parameter node
On the Scenario Settings tab, add a stress testing API, click the drop-down arrow next to Add Instruction, and then select Parameter.
On the Data Source Parameters tab, select existing parameter names.
NoteIf you want to use each row only once to assemble requests, select Use Once. When the required data is polled once, the stress testing scenario stops generating new stress testing requests, regardless of the configured load level.
If you want to recycle parameters during a stress test, do not select Use Once.
You can select Use Once or Baseline Column, but not both for parameters. If you select Use Once, you cannot select Baseline Column.
(Optional) On the Custom Parameters tab, define parameters.
Use an existing parameter
On the PTS Scenario page, click Parameters in the lower part of the page.
Click the Session Parameters tab. Then, click the icon that corresponds to a parameter in a business session to copy the parameter content.
On the Body Definition tab of the API that you want to manage, paste the parameter content to the text editor and edit the content. For example, you can combine strings, parameters, or functions in the body.