Configuring delimited files as a data source
Delimited files contain "columns" of data that are separated by a specific character (for example, a comma or a tab).
About this task
A file data source can be used to populate tag values from the contents of complete files. Two file types, delimited and fixed width are available when you use a file data source. The configuration of a delimited file source is similar to that of a Microsoft™ Excel source.
Procedure
- Click Browse to locate
and select the file to be used as the data source.
If the test data source location is on a mapped network drive, you might get errors when running performance tests. To prevent any errors, ensure that the files are available on a local drive that can be accessed by HCL OneTest™ API.
- Select the Delimited option under the file location.
- Select a character encoding from the Encoding list.
- Use the Format Configuration to define the contents of the file (for example, if it contains a header row, or if there are rows that can be skipped before the header row).
- Under Delimiter Options, set the type of delimiter that is used in the file. Indicate whether the delimiter is ignored within quoted text. HCL OneTest™ API treats delimiter characters that are enclosed in a quoted string as the character and not as a delimiter.
- Enable the Other option
to specify a different character or a string of characters as the
delimiter. Note: If multiple characters are used as the delimiter, the "Ignore" option is disabled.
- If required, you can test the delimiter settings by clicking Calculate push button next to Column count to see how many columns are recognized in the file.
- Enable the Treat empty strings as null option if you want to treat empty fields in the data source as null.
- Enable the Treat text as null option
if you want to specify a string field value that is to be replaced
with null. For example, the file can contain "NULL" for fields with
no value instead of using empty fields. In this case you would enter
"NULL" in the text field, instructing HCL OneTest™ API to return
a null value for such fields. Note: Treating empty fields or other field content as null can be useful when you are using repeating elements in a data source, or when you are filtering test data. When you preview the data, null values (empty fields or text that is specified) if enabled, are highlighted. The highlight color can be specified in HCL OneTest™ API preferences).
- If Auto map new columns to tags at runtime is selected (the default value), then the values in any new columns that are added to the test data set are used as test data. This assumes that a tag exists that exactly matches each new column name and that the column count property is not set.
- If the number of test iterations can exceed the number of rows in the file, enable the Loop Data option to force HCL OneTest™ API to process the same rows repeatedly.
- Click Refresh to generate a preview of the data that is returned.
- Save the data source when finished. See Creating tags from data source fields for details about creating tags by copying column names.