Create Test Data Profiles


Test data profiles can significantly help the efficiency of your testing process, especially when dealing with large sets of similar data. For example, we need 1000s of data sets to test the login functionality of any website. Test data profiles are helpful in such cases. This article will discuss how to create a test data profile.


Prerequisites


Steps to Create Test Data Profiles

  1. Navigate to Test Data > Test Data Profiles and click on Create Test Data Profile. Create Test Data Profile
  2. On the Test Data Profile page that opens, go to Test Data Profile Info and enter the name you want to assign to your test data profile. Test Data Profile Name
  3. Add rows and columns as per the requirements by clicking on Add New Row and Add New Column respectively. Rowns & Columns
NOTE:

If you want to create test data that is expected to fail, you can enable the toggle button in the column ETP (Expected to Fail). ETF

  1. Click on Create. Create

Here’s a quick GIF that demonstrates how to create a test data profile. Create Test Data Profile


Steps to Associate Test Data Profile to a Test Case

  1. Navigate to Create Tests > Test Cases and click on Create Test Case. Create Test Case
  2. On Test Case details page, go to right side navigation bar and click on Test Case Settings. Test Case Settings
  3. From Test Case Settings page, choose Test Data Profile from the drodown. Test Data Profile
  4. Enable the Data Driven toggle. Once you have enable the data driven testing in your test case, you can narrow and customize the various data sets from your test data profile that are being used in your test case using the filters iteration, parameter, set name. Data-driven

    • Iteration: This type of filtering applies only to sequential data sets. The data sets can be filtered using the filter operations greater than, less than, or between.
    • Set name: This filtering type applies to nonsequential data sets. Here, the data sets are filtered by data set names using the operations between, equals, contains, starts with, and ends with. Any data set names containing the set name or part of it are used in the test case.
    • Parameter: This type of filtering is applicable for nonsequential data sets. Here, the data sets are filtered using parameters used in data sets.
  5. The Test Data Profile is linked to Test Case.

Using Test Data Profile in a Test Case

  1. Navigate to Create Tests > Test Cases and click on Create Test Case. Create Test Case
  2. Create test steps as mentioned in the screenshot below: Test Steps
  3. Delete test data placeholder from the above line and choose @ Parameters from the drop-down. Parameter
  4. On @ Parameter overlay, select Test Data Profile and Parameter Name. Parameter Overlay

Here’s a quick GIF that demonstrates how to associate and use test data profile in a test case. TDP in Test Cases


Data-driven Testing with Dynamic Data Sets

In data-driven testing, you can only iterate values from start to end. If you want to iterate from data sets from the middle, you have to set the variables in a prerequisite test case and use the variables as start and end by enabling data-driven testing to the test case.

Set the Variables in a Prerequisite Test Case

  1. Create a Test Case by navigating to Create Tests > Test Cases.

Test Case

  1. Store start and end data values in RunTime_TestData_Set_Start and RunTime_TestData_Set_End, respectively in your test steps.

Store Values

For example, in the above test case, we store delhi in RunTime_TestData_Set_Start and chennai in RunTime_TestData_Set_End.

Creating Data-driven Test Cases with Dynamic Data Sets

  1. Create a Test Case by navigating to Create Tests > Test Cases.

Test Case

  1. Click on Test Case Settings and select the above test case as a prerequisite from the dropdown.

Test Case Settings

  1. Select the Test Data Profile, enable the Data Driven toggle, and select Overwrite Test Data Set with runtime variable for Data iterates from/to dropdowns.

Set Settings

  1. Create test steps and click on run to execute the test case.

Alternatively, you can also set values using Data iterates from/to dropdowns.

Alternatively


Additional Actions Possible on Test Data Set Name

  1. Store: When a test data profile is associated with a test case. The test data set name associated with the test data profile can be stored into a variable for later use as well. Below is how the syntax for the Store NLP looks like:

store-iteration-count-test-data-set-name

  1. if: The test data set values, from a test data profile being iterated, can be compared within an if condition too. Below screenshot shows the NLP (The NLP can be added as a part of add-on “String Compare”. You can find the add-ons to use here: https://testsigma.com/addons):

the verify if NLP that is available with the addon String Compare