Navigation


Application > Select Application > Select Version > Test Data


We will be taken to the Test Data Profile page by clicking on Test Data menu item on the left navigation pane.


Create Test Data Profile

  

To create a new Test Data Profile, click on +Create button on the Test Data Profile Page. We would be taken to Create Test Data Profile page:




Let us work with a scenario of adding login data to a Test Data Profile. This Test Data Profile will be added to a Test Case later so that the Test Case iterates with the Data sets.



Test Data Set Name
Test Data Set Description
Expected to Fail
Test Data Parameter
---
---
---
Username
Password
Login_dataSet1
valid_data
False
validuser1@testsigma.com
xxxxxxxx
Login_dataSet2
valid_data
False
validuser2@testsigma.com
xxxxxxxx
Login_dataSet3
invalid_data
True
invaliduser@testsigma.com
xxxxxxxx


In this case, we are going to add 2 Test Data Parameters, Username and Password.

Each set of Test Data in this scenario corresponds to a pair of Username and Password.

We are going to add 2 sets of valid login data and 1 set of invalid login data and we want to execute a particular Test Case with that data.


Enter data in the fields on Create Test Data Profile page as given below:


Name (Required): Enter a name for the test data profile to be created.


Enter Test Data Profile in JSON: Enter test data in JSON Objects format.

You can either enter the Test Data in this field in JSON Objects format or you can enter the Test Data a set of values in the following table and Testsigma will take care of the rest.


Test Data Set Name: Enter a unique name for the individual Data Set to identify the results for each iteration it in the Test Results.


Test Data Description: Enter a meaningful description that tells us about the current Data Set.

In our case, we have included the valid/invalid adjective for the Test Data Set here.


Expected to fail: Enabling this field helps us to validate negative test cases and if the test fails in execution, we will mark it as Passed in Test Results.

It is disabled by default and should not be changed while using positive or valid Test Data.

In our case, we have kept it disabled for first two valid Data Sets and enabled it for last invalid Data Set.


Test Data Parameter Name: This is where we enter the Title for the actual data values to be added in Test Data Sets.

In our case, the parameter names are Username and Password.

  


And there are four buttons which are:


Add Test Data Set: Click on this button to add a new set/row of data.

In our case, 1 Test Data Set corresponds to a pair of Username and Password i.e 1 row of Test Data.


Add Test Data Parameter: Click on this button to add a new data value to the existing set

In our case, we already have the Test Data parameters Username and Password.


Delete Test Data Set: Click on this button if you need to delete the recently added Test Data Set/Row.

In our case, it is the last data set we added i.e login_data3


Delete Test Data Parameter: Click on this button if you need to delete the recently added Test Data Parameter/Column

In our case, it is the Password parameter/column



We need to enter the data in the above table to the Table in Create Test Data Profile page and after entering the data, it looks similar to the image given below:



Finally, click on Create button and we will get a success notification for the Test Data Profile creation and we will be taken to Test Data Profile page.



Working Details and Usage


When we enter the data in the Test Data Set table, it is converted into JSON Objects format by Testsigma automatically. This is how the above given table looks in JSON Objects format and you can view it in the Edit Test Data Profile page.


[
  {
    "name": "Login_dataSet1",
    "description": "valid_data1",
    "expectedToFail": false,
    "data": {
      "Username": "validuser1@testsigma.com",
      "Password": "xxxxxxxx"
    }
  },
  {
    "name": "Login_dataSet2",
    "description": "valid_data2",
    "expectedToFail": false,
    "data": {
      "Username": "validuser2@testsigma.com",
      "Password": "xxxxxxxx"
    }
  },
  {
    "name": "Login_dataSet3",
    "description": "invalid_data",
    "expectedToFail": true,
    "data": {
      "Username": "invaliduser1@testsigma.com",
      "Password": "xxxxxxxx"
    }
  }
]




For example, 

If you want to use the above created Test Data profile in a Test Step using the Type [test data] in [UI Identifier] template,

you must replace the [test data] part with @|Parameter| block where Parameter is replaced by Username.


The Test Case will be iterated with the username values validuser1@testsigma.com, validuser2@testsigma.com, and invaliduser1@testsigma.com i.e The Step will be repeated 3 times.


Once the Test Data Profile has been created as follows, we can now use them in Test Cases now. We just need to set the Test Case type as data-driven and select the Test Data profile in the Test Data field while creating/updating Test Cases.


Select the Import Test Data Profile radio button if you want to import data from an Excel file.

Please refer to this article for more details on importing Test Data - How To Import Test Data Profile?