Creating an Input Parameter Based on a Multi-Column Data File

Parameterization from multi-column data files is a powerful means of parameterizing data. It defines files in which specific combinations of string values are stored. Each column in a data file corresponds to a specific parameter. Multi-column data files enable a data-driven test model and allow you to cover all user-data input with a single data file.

  1. Choose File > Add TrueLogs . The Open dialog box opens.
  2. Select a replay database TrueLog and click OK. The replay TrueLog opens in TrueLog Explorer.
  3. Click Customize Input Parameters on the workflow bar. The Workflow - Customize Input Parameters dialog box opens.
  4. Click Customize input parameters. The first API node in the test script that includes input parameters is selected and the Step through TrueLog dialog box opens with the Input parameters option button selected.
    Note: If you do not want to customize input parameters for the selected node, click Find Next to advance to the next node that incorporates input parameters.

    Graphic that shows data customization
  5. In Input Parameter or SQL Command view, right-click an input parameter and choose Customize Value. Two methods are available for modifying values in scripts. You can use an existing parameter that has previously been defined in the dclparam or dclrand sections of the BDL script, or you can create a new parameter. New parameters can be created from constant values, random variables, or variables based on data in multi-column data files. The Parameter Wizard - Customize Value dialog box opens.
  6. Click the Parameter from Multi-column Data File option button and click Next. The Parameter Wizard - Parameter from Multi-column Data File page opens.
  7. Perform one of the following steps:
    • Select a preconfigured multi-column data file from the File name list box.
    • Create a new multi-column CSV (Comma Separated Values) file by clicking New file. Then, enter a name for the new file and click OK.
  8. Right-click columns to edit column names, add/delete rows, or add/delete entire columns.
    Note: Each column represents a separate parameter that is assignable to a single input value.
  9. Type data into the data fields as appropriate. Alternatively, you can select column header names directly to customize them.
  10. Customize Handle name or the Parameter name as required.
  11. Click Next to save the file. The Choose the Insert Attribute of the Parameter page opens.
  12. In the Row selection order group box specify the order in which the values from the multi-column data file are to be assigned:
    • Random - Using function FileGetRndRow, the parameter will be assigned from a random row in the data file.
    • Sequential (machine-wide) - Using the functions FileCSVLoadGlobal and FileGetNextRow, the parameter will be assigned from the next sequential row in the data file, on a machine-wide basis. All virtual users on a machine will use the same global row pointer for the current row.
    • Sequential (test-wide) - Using the functions FileCSVLoadGlobal and FileGetNextUniqueRow, the parameter will be assigned from the next sequential row in the data file, on a test-wide basis. All virtual users across all machines will use the same global row pointer for the current row. Check Remove used data rows to automatically remove data from the data file, once it has been used.
      Note: The removed data cannot be restored.
  13. In the Attribute group box, specify the frequency at which new insertions should be inserted. For example, specify if a new username should be inserted with each transaction or only once per test.
    • Per transaction
    • Per test

    All available user groups and transactions are available from the Per transaction list boxes.

  14. Click Finish. TrueLog Explorer modifies the test script and saves the multi-column data file.
Customized input parameters are indicated in green.

Initiate a Try Script run with the random variable function in your test script to confirm that the script runs without error.