Manage Test Data

Manage Test Data

Introduction

The Test Data functionality allows testers to execute same test case multiple times with different data inputs; without having to create duplicate/repeated test cases. It replaces the traditional practice of entering hard-coded input values with parameters. Test Data allows QA teams to store reusable test data in one centralized location and import existing parameters and data sets. Managing test cases with test data is one of the ways to make your tests consistent and manageable. You can create automated data-driven tests quickly using Test Data in QAS.

Example

The following values need to be validated against Username and Password in the Login test case.

Username

Password

Username

Password

David

admin123!

Liza

admin123$

Mathew

admin123%

Create Test Data

Users can create the internal test data (CSV) to use in test cases.

Expand the Test Data section on the tree at left.

You can add a new file for test data in the existing folder or you can also add a new folder and then add the test data file in it.

Options available on the folder structure:

  • Add New Folder

  • Add New Test Data

  • Refresh Folders

  • Collapse Folders

Right-click options available on the Test Data Folder

Once you create a test data folder, right-click on it to see the following options:

  • Create New File: Create new test data under the selected test data folder.

  • Create New Folder: Create a sub-folder under the current folder.

  • Cut: Cut the folder to paste it.

  • Copy: Copy the folder to paste it.

  • Paste: Paste the cut/copied folder.

  • Rename: Rename current folder.

  • Delete: Delete the current folder.

Right-click options available on the Test Data

  • Cut: Cut the test data file to paste it.

  • Copy: Copy the test data file to paste it.

  • Paste: Paste the cut/copied test data file.

  • Rename: Rename the current test data file.

  • Delete: Delete the current test data file.

You can create test data in either of the following ways:

  • create test data manually

  • import test data file into QAS

Create Test Data Manually

Follow the steps mentioned below to create test data manually.

1. To create test data manually, first open the test data file by selecting it on the tree.

2. Click on the Manual button.

The Manage Columns panel opens.

Manage Columns

You can add, edit and delete columns using this panel.

The Manage Columns panel opens to enter columns.

To add a new column, enter Column Name and then click Add.

You can also change the sequence of the columns through the drag & drop operation.

Edit/Delete Columns

To edit the column name, click on the cell and edit it.

To delete the column, hover over the column name. The Delete icon becomes visible; click on it.

On the test case detail screen, the column headings for the test data file will appear in accordance with what you have saved on the Manage Columns screen.

Add Properties to Columns

Once the columns are added, you can add properties to these test data columns.

Steps

1. Select the test data on the tree for which you want to add column properties.

You can see the added columns for the test data. The cells under the columns are editable.

2. Click in the cell and enter the property values.

The next row gets added automatically.

This way, you can add multiple columns and their properties for a test data.


Import Test Data

You can import readily available CSV file containing test data in it.

Steps

1. Select the test data on the tree.

You can see two options to create test data: Import and Manual.

2. Click on the Import button.

3. To attach the test data file, you can either drag & drop the file in the given area or browse the file and select it.

Note: The maximum allowed file size is 200 KB.

You can see one record of the file is added on the screen.

4. Click on the Upload button to upload the file.

Once the file is imported, the test data starts displaying on the screen. You can then link this test data to test cases.

Mask Test Data of a Column

You can mask the entire column data in the Test Data section.

Note: This would be only UI level data masking.

1. Go to the Test Plan module.

2. Open the Test Data section.

3. Click on the mask icon for the column the data of which you want to mask.

To unmask the data of the column, click on the same icon.

Use Test Data

You can use the manually created test data or imported test data in the test cases. The following steps describe how the test data can be used in test cases.

1. Record a test case

You need to record the test case to construct a basic format of the test steps.

Record a test case as usually you do. For example, we are creating a test case Verify Login to link the Login Test Data to it.

You can see the input parameters contain the actual values you entered while recording the test case.

2. Link Test Data

To link a data set with the test case, click on the Link Dataset icon at the top.

 

A. Select Test Data

B. Data Driven Configurations

A. Select Test Data

Open the drop-down. It shows folder structure of created test data. Expand the folder and select the test data you want to link with the test case.


B. Data Driven Configurations

You can make configurations to define how the data from the linked test data file will be used in the current test case. Select either of the following options as per your requirement.

Once you select the required option, click Link at the bottom.

a) None: If you do not want to consider the test data for the test case, then select this option. The linked test data will be ignored and the test data will not be used while test execution.

b) Specific: If you want to use only specific rows of the test data in the current test case, then select this option. Mention the specific row number that is to be considered while test execution. You can mention multiple rows with comma separated values.

c) Range: If you want to use only selective range of rows from the linked test data, then use this option. The test data from the defined range will be used while test execution.

d) All: Select the option to use all the data in the linked test data file while test execution.

Once you select the required option, click Link at the bottom.

 

On the test case screen, the linked test data name is displayed at the top in the place of Link Dataset icon.

You can also edit the association or change the data driven configurations by clicking on the Edit Dataset icon.

To remove the associate of test data with the test case, click on the Unlink Dataset icon.

3. Apply Test Data and Replace Input field values with placeholder

You nee to replace the input field values on the grid with placeholder in the format as mentioned below.

Syntax of placeholder: ${column_name}

 

Steps

1. Open the test case recorded as mentioned in the Record Test Cases section above.

2. To edit the input value for the command, click on the Edit icon.

The Action Properties panel opens on the screen.

3. Click on the Edit icon for the input field.

As per the Login example cited in the previous sections, we have multiple combinations of Username and Password in the test data file.

There are two columns in the test data file: Username and Password.

For Command = "Type" and Locator name = "username", replace the input field values with ${username} placeholder 

For Command = "Type" and Locator name = "password", replace the input field values with ${password} placeholder 

4. Once you are done with editing the input field value, click Update at the bottom of the panel.

Now you can see the input field values are replaced with placeholders.

4. Execute Test Case with Test Data

Execute the test case by clicking on the Dry Run button.

Select the Profile to run the test and click on the Dry Run button at the bottom.


The test will run multiple iterations in accordance with the properties entered in the test data file.

The test step will be executed for each value of the input field.

 

In the Analytics, you can view the execution results for the test case.