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

  1. 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 tests. To prevent any errors, ensure that the files are available on a local drive that can be accessed by HCL OneTest™ API.

  2. Select the Delimited option under the file location.
  3. Select a character encoding from the Encoding list.
  4. 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).
  5. 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.
  6. 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.
  7. 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.
  8. Enable the Treat empty strings as null option if you want to treat empty fields in the data source as null.
  9. 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’s preferences).
  10. 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.
  11. 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.
  12. Click Refresh to generate a preview of the data that is returned.
  13. Save the data source when finished. See Creating tags from data source fields for details about creating tags by copying column names.
Feedback