Editing datasets

You can add, modify, remove, import, or export data in a dataset by using the Dataset Editor. The Dataset Editor operates similarly to a spreadsheet.

Before you begin

You must have completed the following tasks:

About this task

In Test Performance 11.0.1 or later, you can use the Dataset Editor to view and edit data in the dataset. You can also view the datasets in other editors by right-clicking the dataset and then by selecting the Open With option.

You can perform various tasks such as updating cell data, inserting or deleting rows and columns, and renaming column names, by right-clicking any row, column, or cell.

When you edit the dataset in a Dataset Editor, you can use the following keyboard shortcuts to control the cursor selection in the Dataset Editor:

keyboard shortcuts

Description

Tab

Move the cursor control to the next available option.

Shift+Tab

Move the cursor control to the previous option.

Shift+F10

Open the context menu from the dataset cell.

You can resize the width of rows in the Dataset Editor. If a cell contains a large amount of data, select the cell and modify the data in the Edit field.

If a CSV file contains data separated by a character, then you can import that CSV file into the dataset. You select any of the following separator characters from the Separated by drop-down list, and the selected character becomes the separator 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 Separated by drop-down list.

Note: The default separator value is Comma.

Procedure

  1. Double-click the dataset that you want to edit in the Test Navigator.
    The dataset opens in the Dataset Editor in a browser.
  2. Perform the following actions to use the options available to edit in the Dataset Editor:
    Options Actions
    Find and Replace find icon To find a text:
    1. Click the Find and Replace icon find icon.
    2. Enter the text that you want to search in the Find field.
    3. Select any or all the following options to find the search content more effectively:
      • Click the Case sensitive icon case sensitive icon to search the text that is the exact letter case of the content entered in the Find field.
      • Click the Match entire cell contents icon match entire cell icon to search cells that contain only the characters that you entered in the Find field.
      • Click the Search using regular expression icon search regular expression icon to search the pattern that matches strings.
        For example, to search for a cell that contains any number between 0 to 9, perform the following steps:
        1. Enter \d in the Find field.
        2. Select the Search using regular expression search regular expression icon icon.
        3. Click the Find icon find icon.
    4. Click the Find icon find icon. If the text is found, select the cell that contains that text.
    5. Click the Find icon find icon again to find further instances of the search text.

    To find and replace:

    1. Click the Find and Replace icon find icon.
    2. Enter the text in the Find field, and then click the Show Replace icon show replace icon.
    3. Enter the text that you want to replace in the Replace field.
    4. Select any or all the following options to find and replace the text more effectively:
      • Click the Case sensitive icon case sensitive icon to find the text that is the exact letter case of the text entered in the Find field.
      • Click the Match entire cell contents icon match entire cell icon to find and replace for cells that contain only the characters that you entered in the Find and Replace fields.
      • Click the Search using regular expression icon search regular expression icon to find and replace the pattern that matches strings.
    5. Click the Replace replace icon icon to replace the individual instances.
    6. Click the Replace All icon replace all icon to replace every instance of the content throughout the dataset.
    Undo undo_icon
    1. Click the Undo icon undo_icon.
    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. The Dataset Editor saves the unlimited undoable action. You can perform the undo action even after you save your changes made to the dataset.

    Redo redo_icon
    1. Click the Redo icon redo_icon.
    2. Select the recent changes from the list that you want to redo, and then click the list.

    The Dataset Editor saves the unlimited redo action.

    Import import_icon
    1. Click the Import icon import_icon, and then select the option Import a CSV file from the drop-down list.
    2. Click Select file, and then select the CSV file that you want to import in the Import Dataset dialog.
      Note: If the CSV file contains test data with Unicode characters in it, you must save the CSV file in UTF-8 format. You can then choose the CSV file and import the test data from the CSV file into the dataset.
    3. Optional. Switch on the First row contains headers option if your CSV file contains the header.
    4. Optional. Switch on the Overwrite existing data option to add the rows and columns from the selected CSV file from the beginning of the dataset.
    5. Optional. Switch on the Append existing data option to add rows and columns from the selected CSV file to the end of the dataset.
    6. Click Import.
    Export export_icon 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 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 and 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 and 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.

    Edit You can edit the data associated with a selected cell in the Edit field.
    Configure You can set the separator value, change the row and column settings, and configure the string values in the dataset in the Configure panel.
    1. Select any of the separator values that you used in the CSV file from the Separated by drop-down list.

      The available options are Comma, Semicolon, Space, Tab, and Other. In the CSV file, if you see any other separator characters other than the available options, then you can select the Other option, and then you 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.

    2. Configure the following options to change the row and column settings:

      Option

      Action

      Column header

      Enter the required value of the column header.

      Data start point

      Enter the value of the data starting pointer.

      Current row

      Enter the value of the current row.

    3. Configure the following options to change the string values in the dataset:

      Option

      Action

      Treat as null

      Enter a string value that is to be treated as null when you run the test.

      Treat as empty

      Enter a string value that is to be treated as empty when you run the test.

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

      Treat empty text as null

      Select the checkbox when you want the dataset that contains any blank cells, and the value of those blank cells to be interpreted as null.

    Discard discard_icon Click the Menu icon menu_icon, and then select Discard to discard the changes made to the dataset.
  3. Click the Save icon save_changes_made_to_dataset to save the changes made to the dataset.

Results

You have edited the dataset.