Datasets

In Web Performance products, a collection of data that is used to dynamically change the actions of a testcase is known as a Dataset. A dataset is a collection of tabular data, similar to a spreadsheet. After creating a dataset, it can be used to customize the testcase.

In this example picture of the Dataset Editor, the dataset contains two fields (columns), Username and Password. It also has many rows, each of which contains values for the Username and Password fields.

Creating a dataset

Datasets may be created empty or imported from an external file. They may then be edited manually (cell by cell) or entire rows may be filled by selecting the column (press the column header) and then the Fill... button.

Create a new dataset

In the Navigator view, the pop-up menu which appears from any existing dataset or the Datasets folders in each repository contains a New Dataset item. Selecting this menu item will open the New Dataset dialog:

Enter a name in the name field and then press the Add button. You may then type each field name, separated by the <return> key to define the fields in the dataset. After pressing the OK button, the dataset will be created with one row of sample data and the Dataset Editor will be opened. Values for each field can be entered within the Dataset Editor.

Import a dataset from an external file

A dataset can be created using existing data in CSV or text format. From the Navigator view, select the Import item from the pop-up menu on any dataset or the Datasets folder. Selecting this menu item will open the Import Dataset dialog:

 

1. Choose the file to import

2. The file may be imported into either a new or existing dataset

3. Choose the field separators. For CSV files, choose comma. This example uses tab characters between each field.

4. By default, the import process will automatically remove any leading and trailing white-space from each entry. This feature may be disabled when needed.

5. If the first row of the imported file contains the names of the fields, enable the "Use first row..." option. The import process will create a dataset with matching field names. If not, field names will be generated. They can be edited later in the Dataset Editor.

6. If your file contains characters that are escaped, you may select this option to parse them as escaped characters. This is useful if you must import values which span multiple lines. Simply ensure that in your file, each row in the dataset appears on it's own line, and that line breaks within individual values are replaced with the characters "\r\n" (or an appropriate new line sequence for your application server). Once imported with the "Parse escaped characters" option, tooltips over each dataset value will display the complete value with line breaks.

7. As the import options are selected, the Preview section will display what the first 10 rows of the dataset would contain if the current settings were used.

Refreshing imported datasets

While the Dataset Editor provides a convenient interface for editing the values in a dataset, there are times when it may be more convenient to modify the data with external tools (such as a database query). After a dataset has been imported, it may be re-imported easily from the Navigator pop-up menu (Reload item) or the Dataset Editor (Reload button). The original settings will be remembered and re-used automatically.