Creating test data from tags in a test

You can create test data from the tags defined in a test from the Test Editor. You can then use the test data to validate the results that are returned by different test actions.

Before you begin

You must have completed the following tasks:
  • Created a test. See Tests: Overview and tasks.
  • Created tags that you want to use in the test. See Create tags.
  • Opened the test in the Test Editor view in the Test Factory perspective.

Procedure

  1. Click the Edit or Create Test Data icon Image of the Create data source icon..

    The Edit or Create Test Data dialog is displayed.

  2. Perform the following actions in the Edit or Create Test Data dialog:
    1. Select the type of the file from the Data File Type list.
      You can select from the following options:
      Option Description Action
      Excel Saves the tags and their values in an Excel spread sheet. Select this option if you want to create an Excel file with the test data.
      CSV Saves the tags and their values in a comma-separated values (CSV) file. Select this option if you want to create a .csv file with the test data.
    2. Perform an action from the following options:
      • Enter a name for the file in which you want to save the test data.
        Note: The file is created in the operations folder in your project directory.
      • Click Browse in the Test Data File field, and go to a folder that contains an existing file in which you want to create the test data.
        Note: The default folder that contains the test data files is the operations folder in your project directory.
    3. Click Browse in the Test Data Set field and select a different resource, if you want to associate the test data set with a different operation.
    4. Perform any of the actions indicated for each of the options in the following table:
      Option Description Action

      Don't use this test data in an action yet

      Specifies whether the test data that is created in the test is not to be used until you indicate the test data to be used in test actions.

      Select this option in any of the following scenarios:
      • You have not configured any test actions.
      • You do not want to use the test data in any of the actions.

      Use this test data in a new action

      Specifies whether the test data is used in any of the following test actions:
      • Iterate Test Data
      • Lookup Test Data
      • Fetch Test Data
      Select this option when you want the test data to be used in any of the following actions:
      • Iterate Test Data
      • Lookup Test Data
      • Fetch Test Data

      Use this test data in an existing action

      Note: This option is enabled if you configured any test actions in the test.
      Specifies whether the test data is to be used in an existing test action configured in the test.

      Select this option when you want to use the test data in an existing test action, and then select the test action from the list.

    5. Click Next.
      Any of the following events can happen:
      • If you selected an existing file, you are prompted to overwrite the existing file. You can click Yes to overwrite the contents in the existing file.

        The Select Tags dialog is displayed.

      • If you selected a new file, the Select Tags dialog is displayed.
  3. Select the tags that you want to use as test data in the test actions, and then click Next.

    The Null handling dialog is displayed, in which you can specify how the values in the test data are to be used with the tags in the test action.

  4. Perform any of the actions indicated for each of the options in the following table:
    Option Description Action

    Treat empty strings as null

    Specifies whether the empty strings in the test data are treated as null in the tags defined in the test.

    Select this option when you want empty strings in the test data to be treated as null in the tags defined in the test.

    Treat text as null

    Specifies whether the text values in the test data are treated as null in the tags defined in the test for the following options:
    • When it is inferred as null.
    • When you specify the text values that are to be treated as null.
    Select this option when you want the text values in the test data to be treated as null in the tags defined in the test for any of the following conditions:
    • When it is inferred as null.
    • When you specify the text values that are to be treated as null.

    Treat text as empty string

    Specifies whether the text values in the test data are to be treated as empty strings in the tags defined in the test.

    Select this option when you want the text values in the test data to be treated as empty strings in the tags defined in the test.

    Edit DataSet data on finish

    Specifies whether you want to edit the created dataset immediately after you configured that test data.

    Select this option when you want to view and edit the dataset.

  5. Click Finish to complete the creation of the test dataset.

Results

You created a test dataset that you can use with the test actions that you configure in the test.

What to do next

You can perform any of the following actions:
  • Configure the test actions in the test.
  • Associate the test data with the supported test actions.
  • Run the test.
  • Edit the test data file, if you want to change any of the configurations of the test data.