Editing a dataset

You can add, modify, remove, import, or export data from a dataset.

Before you begin

You must have created a dataset or configured a repository that contains the dataset.

About this task

If you are a project Owner or Tester in HCL DevOps Test Hub (Test Hub), you can perform basic tasks in the datasets by right-clicking any row, column, or cell in the dataset to organize your data in a better way. For example, you can perform tasks such as updating data in a cell, inserting or deleting rows and columns, or renaming column names.

After you edit the dataset, you can save the changes made to the dataset, and then you can publish the dataset to the Git repository. If you save and close the edited dataset, the Changes page lists the edited dataset and later you can publish it to the Git repository for other members to use.

When you have a CSV file that has data separated from a character, then you can import that CSV file into the dataset. You can select any of the following separator characters from the Configure Dataset window, and the selection can be the separator character that you used in the CSV file:
  • Comma
  • Semicolon
  • Space
  • Tab
  • Other
Consider that you have the data in the CSV file in the following format:
ds_sep_csv
When you import the CSV file in the dataset, and then select the separator value as Semicolon, the data in the dataset is displayed as follows:
sep_char_ds_imported
If you want the data in its original format, that is, a semicolon (;) character to separate the data, then you can choose any other separator value from the Configure Dataset dialog.
Note: The default separator value is Comma.

Procedure

  1. Log in to Test Hub.

    The team space that contains your project is displayed.

  2. Click Active projects > 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 that contains your project with the datasets that you want to edit.

    The projects in the selected branch are displayed in the Data navigator panel. The datasets are listed under the folder you created to contain the dataset within a logical folder named Datasets.

  5. Click the dataset in the data navigator.

    The dataset opens in the right pane.

  6. Click Edit.
  7. Select your action to either select an existing Edit branch or create an Edit branch:
    • Perform the following steps to select an existing Edit branch:
      1. Select Use an existing edit branch.
      2. Select an Edit branch from the Select branch list if Edit branches already exist in the selected branch of the repository.
        Note: A warning message is displayed if the Edit branch, which you selected, is behind the source branch. To update the selected edit branch and maintain synchronization with the source branch, you can select the Update branch option when switching checkbox.
      3. Click Ok.
    • Perform the following steps to create the Edit branch:
      1. Select Create new edit branch.
      2. Enter a name for the Edit branch in the Branch Name field.
      3. Click Save.
  8. Perform the following actions to use the options available for editing:
    Options Actions
    Find and Replace fina_and_replace_icon To find:
    1. Click the Find and Replace icon Image of the Find icon.
    2. Enter the content that you want to search in the Find field.
    3. Select any or all the following options to find the search content more effectively:
      • Select the Case sensitive icon Image of the case sensitive option icon to search the content that is the exact letter case of the content entered in the Find field.
      • Select the Match entire cell contents icon Image of the entire cell contents option icon to search for cells that contain only the characters that you have entered in the Find field.
      • Select the Search using regular expression icon Image of the regular expression option icon to search the pattern that matches strings.
        For example, to search a cell that contains any number between 0 to 9, do the following:
        1. Enter \d in the Find field.
        2. Select the Search using regular expression checkbox.
        3. Click Find.
    4. Click the Find icon Image of the Find icon. If the text is found, the cell containing that text is selected.
    5. Click the Find icon Image of the Find icon again to find further instances of the search text.

    To find and replace:

    1. Click the Find and Replace icon Image of the Find icon.
    2. Enter the content that you want to search in the Find field.
    3. Enter the content that you want to replace in the Replace field.
    4. Select any or all the following options to find and replace the content more effectively:
      • Select the Case sensitive icon Image of the case sensitive option icon to find the content that is the exact letter case of the content entered in the Find field.
      • Select the Match entire cell contents icon Image of the entire cell contents option icon to find and replace for cells that contain only the characters that you have entered in the Find and Replace fields.
      • Select the Search using regular expression icon Image of the regular expression option icon to find and replace the pattern that matches strings.
    5. Click the Replace icon Image of the replace option icon to replace the individual instances.
    6. Click the Replace All icon Image of the replace all option icon to replace every instance of the content throughout the dataset.
    Undo icon_undo
    1. Click the Undo icon icon_undo.
    2. Select the recent changes from the list that you want to undo, and then click the list.
    The Undo option reverts the change you made in the dataset.
    Redo icon_redo
    1. Click the Redo icon icon_redo.
    2. Select the recent changes from the list that you want to redo, and then click the list.
    Import import_icon
    You can import variable data into a dataset from the following sources:
    • When there is a large amount of data stored in a CSV file.

    • When you use the data fabrication feature to generate test data.

    Importing data from a CSV file

    1. Click the Import icon import_icon.

    2. Select Import a CSV file from the drop-down list.

    3. Click Select file and choose the CSV file that contains variable data to import into the dataset.

    4. Enable the First row contains headers by using the toggle icon if your CSV file contains the header.

    5. Select one of the following options to append or overwrite data in the dataset:

      • Enable Overwrite existing data by using the toggle icon to add the rows and columns from the beginning of the dataset.
      • Enable Append existing data by using the toggle icon to add rows and columns to the end of the dataset.
    6. Click Import.

    Importing data by using data fabrication

    1. Click the Import icon import_icon.

    2. Select Fabricate data from the drop-down list.

    3. Select a Data definition from the drop-down list.

    4. Enter the number of rows that you want to generate in the Number of Rows field.

    5. Enter a seed value in the Seed (optional) field.

    6. Enable Fabricate headers by using the toggle icon if your schema contains the headers.

    7. Select one of the following options to append or overwrite data in the dataset:

      • Enable Overwrite existing data by using the toggle icon to add the rows and columns from the beginning of the dataset.
      • Enable Append existing data by using the toggle icon to add rows and columns to the end of the dataset.
    8. Click Import.

    Export export_icon You can export variable data from the dataset into a CSV file to reuse in future tests when required. You must have opened a dataset from which you want to export the data.

    Click the Export icon export_icon to download the dataset as a CSV file.

    Set as current row During the test run, if you want variable data to be selected from a current row instead of the first row in a dataset, right-click any cell in a row and select Set as current row.

    When rows are deleted:

    If you delete any row between row 1 and the current row, the current row data is taken from the next row. For example, when you set the current row as 6, and then you delete any row between row 1 to row 6, the current row remains at row 6, but the content of row 7 is moved to row 6.

    When rows are inserted:

    If you insert any new row between row 1 to the current row, the current row data is taken from the previous row. For example, when you set the current row as 6, and then you insert any row between row 1 to row 6, the current row remains at row 6, but the content of row 5 is moved to row 6.

    Dataset Configuration You can configure the dataset by clicking the Menu icon Image of the menu icon, and then selecting Configure. In the Configure Dataset dialog, you can change the row and column settings and configure the string values in the dataset that contains variable data for tests to use when they run.
    • Select any of the separator values that you used in the CSV file.

      The available options are Comma, Semicolon, Space, Tab, and Other. In the CSV file, if you have any other separator characters other than the available options, then you can select the Other option, and then can specify a value.

      For example, if the data in the CSV file is separated by a character #, then select the Other option and enter # in the field.

    • Configure the following options to change the row and column settings:

      • Column header - Use an up-down control button to increment or decrement the value of the column header.

      • Data start point - Use an up-down control button to increment or decrement the value of the data starting pointer.

      • Current row - Use an up-down control button to increment or decrement the value of the current row.

    • Configure the following options to change the string values in the dataset:

      • Treat as null - Enter a string value that is to be treated as null when running the test.

      • Treat as empty - Enter a string value that is to be treated as empty when running the test.

        For example, when you run the test and the data 123 in the dataset is to be treated as empty, then you must specify 123 in the Treat as empty field.

      • Treat empty text as null - Select this field when you want the dataset that contains any blank cells, and the value of those blank cells to be interpreted as null.

    • Click Update to apply the changes.

    Discard discard_icon Click the Menu icon Image of the menu icon and select Discard to discard the changes made to the dataset.
  9. Click the Save icon Image of the Save icon to save the changes made to the dataset or the Save All icon Image of the Save all icon to save all changes made to different datasets by using the same Edit branch.
    Note: if you are editing different files that include datasets or Data definitions simultaneously, you can select your action from the following options:
    To... Do this...

    Keep your current file open and close the open files on the right.

    Right-click, and then click the Close Tabs to right option.

    Keep your current file open and close the open files on the left.

    Right-click, and then click the Close Tabs to left option.

    Keep your current file open and close all the other open files.

    Right-click, and then click the Close Others option.

    Close all open file tabs.

    Right-click, and then click the Close All Tabs option.

  10. Click the Publish icon publish_icon to publish the dataset to the Git repository.

Results

You have edited the dataset.