Managing data definitions in a schema

You can manage and organize data definitions within a schema to support consistent and accurate test data generation.

Before you begin

You must have completed the following tasks:

About this task

You can access a schema in your project and perform actions such as creating or importing data definitions, linking fields, modifying generator settings, and saving schema changes. You can design data relationships by using the Schema View, or use the Database View to align data definitions with your database structure.

Procedure

  1. Log in to Test Hub.

    The Projects page of the initial team space is displayed.

  2. Click My projects > project_name to open the project that contains the test assets.

    The Overview page of the project is displayed.

  3. Click Author > Data.
    The Data page and the data navigator panel are displayed.
  4. Select the schema that you want to edit in the data navigator panel.

    The selected schema opens in the Data page.

  5. You can perform the actions that are listed in the following table to modify data definitions in a Schema View:
    Task Action
    Create an inline data definition

    Perform the following steps:

    1. Click Add Data Definition.
    2. Type a name in the Name field under the Create Inline Data Definition section.
    3. Click Add.

    A table with an empty field is displayed in the schema view.

    Import existing data definitions

    Perform the following steps:

    1. Click the Add Data Definition.
    2. Select the data defintions from the Available Data Definitions section.
    3. Click Add.
    Note: You can use the Search field in the Add Data Definition dialog to find the required data definition.
    Add a relationship between fields

    Perform the following steps:

    1. Hover over the field line until the Drag to connect to a field tooltip appears.
    2. Drag to the destination field in another data definition
    Note: The data type of the source field and the destination field must be the same.
    Define the relationship ratio

    Perform the following steps:

    1. Click the Destination field.
    2. Enter the distribution ratio (For example: One-to-One or One-to-Many) in the Relationship configuration dialog.
    Convert between Referenced and Inline DDFs

    Perform the following steps:

    1. Click the Actions-menu icon on the data definition.
      • Select Convert to Referenced, if the data definition is inline
      • Select Convert to Inline, if the data definition is referenced.
    Rename inline data definition

    Perform the following steps:

    1. Click the Actions-menu icon on the data definition.
    2. Select Rename.
    3. Type a new name in the Rename Data Definition dialog.
    4. Click Rename.
    Add new fields

    Perform the following steps:

    1. Click the Add field icon .
    2. Type a field name in the Name column.
    An empty row is automatically inserted below the current row for your next entry.
    Add generators in fields Drag a generator from the Catalog panel into a field under the Generator column.
    Note: You can use the Search Catalog field in the Catalog panel to find the required generator.
    Replace generators in fields Drag a generator from the Catalog panel into an existing generator field under the Generator column.

    The existing generator in the field is automatically replaced by the generator.

    Modify generator configurations

    Perform the following steps:

    1. Click a generator in the Generator column.
    2. Update the configuration settings in the panel.
    Note: If you modify the configurations of a basic generator, the changes are applicable only when the generator is used as a field in a data definition. The basic generator that is available in the catalog is not modified or saved.
    View sample data for a generator in Schema View

    Perform the following steps:

    1. Click the generator label next to a field in the table in Schema View.

      The properties of the generator is displayed.

    2. Click the View sample data.

      A list of five sample records is displayed, fetched from the source database.

    3. Optional: Click the Reload Sample Data icon to refresh the data from the source.
    Include additional configuration details

    Perform the following steps:

    1. Click the Add new configuration tab.
    2. Type a name and set other settings as an additional configuration to the generator.
    Reorder fields Drag and drop rows in the table to rearrange the fields.
    Delete fields Click the Delete icon Delete icon in the field row to remove the field.
    Remove one or more data definitions from Schema View

    Perform the following steps:

    1. Click the Actions-menu icon on the data definition.
    2. Select Remove from schema.

      The data definition is removed from the schema.

      Alternatively, select the data definition and click Remove (1).

    3. Select the data definitions or that you want to remove and click Remove (#). The number in parentheses indicates the number of data definitions that are currently selected. For example, Remove (2) or Remove (5).

    To remove all the data definitions from the Schema View, perform the following steps:

    1. Select the data definitions in the Schema View by pressing Ctrl+A to select all, or by pressing Ctrl and clicking on each DDF that you want to select.
    2. Click Remove All to remove all the data definition from the schema.

      The Remove All Data Definitions dialog box is displayed.

    3. Click Yes to confirm.
      Note: You cannot undo this action after the data definitions are removed.
    Update data definitions in Schema View
    Perform the following steps:
    1. Click the Update icon update icon to update the default row counts and default distribution ratios for the data definitions within the schema.

      The Update Schema dialog box is displayed, with the Default row counts and Default distribution ratios selected.

    2. Click Update.

    Auto-assign generators to data definitions in Schema View
    Perform the following steps:
    1. Click the Update icon update icon.
    2. Select the Assign generators to fields checkbox.

      The AI Provider option is displayed.

    3. Select the configured AI Provider from the drop-down list.
    4. Optional: Select the Overwrite existing generators checkbox to overwrite the existing generators.
    5. Click Update.
  6. You can perform the actions that are listed in the following table to modify data definitions in a Database View:
    Task Action
    Export a data definition to a schema

    Perform the following steps:

    1. Click the Actions-menu icon on the data definition.
    2. Select Add table to schema.
    Note: The exported data definition changes to green color.
    Select the linked data definitions

    Perform the following steps:

    1. Click the Actions-menu icon on the data definition.
    2. Select Select linked tables.
    Note: The linked data definitions are changed to blue color.
    Add missing columns

    Perform the following steps:

    1. Select the data definition exported to schema.
    2. Click the Actions-menu icon on the data definition.
    3. Select Add missing columns to schema.
    Remove unnecessary fields

    Perform the following steps:

    1. Select the data definition exported to schema.
    2. Click the Actions-menu icon on the data definition.
    3. Select Remove unnecessary fields.
  7. Click the Save icon Image of the save icon. to save the changes made to the schema.

Results

You have updated the data definition within a schema.