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
-
Ensure that you have created a dataset in the workspace. See Creating a dataset in a workspace.
-
Saved a CSV file that contains variable data on your computer.
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.
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. |
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:
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:
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.
Procedure
-
Double-click the dataset that you want to edit in the Test
Navigator.
The dataset opens in the Dataset Editor in a browser.
-
Perform the following actions to use the options available to edit in the Dataset
Editor:
Options Actions Find and Replace To find a text: - Click the Find and Replace icon .
- Enter the text that you want to search in the Find field.
- Select any or all the following options to find the search content more
effectively:
- Click the 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 to search cells that contain only the characters that you entered in the Find field.
- Click the Search using 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:
- Enter \d in the Find field.
- Select the Search using regular expression icon.
- Click the Find icon .
- Click the Find icon . If the text is found, select the cell that contains that text.
- Click the Find icon again to find further instances of the search text.
To find and replace:
- Click the Find and Replace icon .
- Enter the text in the Find field, and then click the Show Replace icon .
- Enter the text that you want to replace in the Replace field.
- Select any or all the following options to find and replace the text more
effectively:
- Click the 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 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 to find and replace the pattern that matches strings.
- Click the Replace icon to replace the individual instances.
- Click the Replace All icon to replace every instance of the content throughout the dataset.
Undo - Click the Undo icon .
- 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 - Click the Redo icon .
- 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 - Click the Import icon , and then select the option Import a CSV file from the drop-down list.
- 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.
- Optional. Switch on the First row contains headers option if your CSV file contains the header.
- 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.
- Optional. Switch on the Append existing data option to add rows and columns from the selected CSV file to the end of the dataset.
- Click Import.
Export Click the 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. -
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.
-
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.
-
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 Click the Menu icon , and then select Discard to discard the changes made to the dataset. - Click the Save icon to save the changes made to the dataset.