File data source

Updated at:

You typically use a file data source with a data configuration node for scenarios that require customized stress testing requests, such as simulating logins with specific users.

Background information

To use a file data source, you must upload a parameter file to the PTS console or OSS. The parameter file must meet the following requirements:

  • The file must be in CSV format.

    Note

    Do not directly change a file's extension from .xlsx to .csv. Instead, export the file from an application like Microsoft Excel or Apple Numbers, or generate it with a program like Apache Commons CSV.

  • The maximum file size is 60 MB.

  • Each line in the file cannot exceed 20,000 characters.

  • If you need to combine data from multiple associated sources into a single set of parameters, you do not need to merge them into one file. You can combine data across different files by using the parameter settings of a data configuration node.

  • If your parameters have a strict one-to-one relationship, make sure they are in the same file and correctly aligned. Each row must contain complete data for all columns to avoid empty fields, which can affect your stress testing data. For example, a parameter file might have two columns for Username and Password.

    john,123456  
    mike,234567  
    lilei,345678

Create file parameters

  1. Log on to the PTS console. In the left-side navigation pane, choose Performance Testing > Create Scene, and then click JMeter stress testing.

  2. On the Create JMeter Scene page, click Data Source Management at the bottom.

  3. You can upload a parameter file in one of two ways:

    • Method 1: Upload a file.

      1. On the Data Source Management panel, go to the File Data Source tab and click + Upload File. In the dialog box, select a local parameter file and click Open.

        Note

        You can also select a previously uploaded parameter file.

      2. Choose whether to select First line as header.

        Note

        If you select First line as header, PTS uses the first row for parameter names and skips it during testing. If you do not select this option, you must manually define a name for each parameter column.

    • Method 2: Use a file from OSS. For more information, see Create an OSS data source.