Generating and exporting schema-based test data to a .zip file

You can generate schema-based test data and export it as a .zip file that contains .csv files. The exported data remains consistent with the schema structure, which supports accurate testing, data validation, and you can use this data to perform data-driven testing across multiple scenarios in HCL DevOps Test Hub (Test Hub).

Before you begin

You must have completed the following tasks:

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 branch from the Branch list.
    The navigation panel displays all the existing projects in the selected branch.
  5. Select the schema from which you want to generate and export test data in the data navigator panel.

    The selected schema is displayed in the Data page.

    Note: You can either enter the name of the Schema in the Search field or expand the project and manually search in the data navigator panel.
  6. Click the Preview icon to preview the test data that you want to generate.

    The test data is generated in the preview dialog.

    Note: You can preview test data to ensure whether the data is in the expected format. You can review the generated test data that can help you to identify any potential issues, inconsistencies, or errors in the schema. If you modify the schema and do not save it, you can still preview the corresponding test data. However, you can generate the test data only after you save the schema.
  7. Click the Generate icon from the Data page.
    The Generate data dialog is displayed.
  8. Select Download as a zip file from the Select destination list.
  9. Type the file name in File Name field.
  10. Optional: Enter the seed value in the Seed field.
    For example, consider that you have used the seed value of 1 to generate data from a schema. When you want to create another data with the same set of values, then you can provide the seed value as 1 during the creation of the test data.
  11. Enter the number of rows that you want to generate in the Generate column.
  12. Optional: Enter a value in the Target field to customize the number of rows to be generated in the tables.
    The default value in the Target field is set to 100%.

    For example, if a table in the database contains 10 rows and if you set the Target field to 200%, then the generated data displays 20 rows.

  13. Click Download to initiate the generation of the data.
    The generated data is downloaded into your local file system as a .zip file.

Results

You have generated realistic and schema-aligned test data and exported it as a .zip file that contains .csv files.

What to do next

You can create a dataset by using the downloaded .csv files. See Creating a dataset by using a CSV file.