You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Instead of hard-coding different values to test the same scenario with different test data, you can use Data Driven testing. In Testsigma, you can
25
+
This tutorial walks you through data-driven testing and how to enable it in the test case. This can involve using external test data profiles as a source within the project to drive its behaviour. The goal is to increase the effectiveness and efficiency of testing by automating repetitive tasks and ensuring comprehensive test coverage. In Testsigma, you can
26
+
29
27
30
-
1.Import or read the test data and/or expected output data from external files or data sources, then
28
+
1.The test data and expected output data can be imported or read from external sources.
31
29
32
-
2.Feed this data into your automated test cases so that you don't need to hard-code the test data into the Test Steps definition.
30
+
2.Using this data, you can avoid hardcoding the test data into the Test Steps definition in your automated test cases.
33
31
34
-
The test steps iterates itself and subsequent rows of data are fed to the test steps as input.
32
+
Test steps iterate and feed subsequent rows of data into them as input.
35
33
36
34
---
37
35
38
-
> ## [Prerequisites:](#prerequisites)
36
+
### **Prerequisites**
39
37
40
-
> 1. You should know [how to create a test data profile](https://testsigma.com/docs/test-data/create-data-profiles/).
41
-
> 2. You should know [how to create a test case](https://testsigma.com/docs/test-cases/manage/add-edit-delete/).
38
+
You'll need to know how to create a [test cases](https://testsigma.com/docs/test-cases/manage/add-edit-delete/#creating-a-test-case), [test data profile](https://testsigma.com/docs/test-data/create-data-profiles/#create-a-test-data-profile), and [runtime variable](https://testsigma.com/docs/test-data/types/runtime/#how-to-use-runtime-test-data-in-test-steps).
42
39
43
40
---
44
41
45
-
## [Step 1: Associate data profile with your test case](#step-1-associate-data-profile-with-you-test-case)
46
-
47
-
1. In **Create** or **Edit** test case form and click on **Show additional options**.
42
+
## **Enable Data-Driven in test case**
48
43
49
-
2. Select the **Test data profile** you want to add to your test cases and enable the toggle **Data Driven** as shown below:
44
+
1. On the **Create** or **Edit** test case page, click on **Show additional options** to unhide the features.
45
+

50
46
51
-

47
+
2. Select the **Test data profile** from the drop-down menu and turn on the **Data driven** toggle.
48
+

52
49
53
-
Enabling the data-driven toggle will enable the test to run multiple times based on the number of rows available in Test Data Profile. For. If the data profile has 5 rows(sets) the test will run 5 times automatically using each data set(row) everytime.
50
+
Enabling the data-driven toggle will allow the test to run multiple times based on the number of rows in the Test Data Profile. If the data profile has five rows(sets), the test will run five times automatically, using each data set(row) every time.
54
51
55
52
[[info | Note:]]
56
-
| You can also select a specific data set if you want to run only once using data from a specific data set in the profile.
57
-
58
-
If you 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*.
59
-
60
-
* Iteration: This type of filtering is applicable only to sequential data sets. The data sets can be filtered using the filter operations greater than,less than, or between.
53
+
| You can also select a specific dataset if you want to run the profile only once, using data from that dataset.
61
54
62
-
* Set name: This type of filtering is applicable for non sequential data sets. Here the data sets are filtered by data set names using the operations between, equals, contains, starts with, ends with. Any data set names containing the set name or part of it are used in the test case.
55
+
Data-driven testing allows you to narrow and customize your test case using filters like *iteration*, *set name*, and *parameter*.
63
56
64
-
* Parameter:This type of filtering is applicable for non sequential data sets. Here the data sets are filtered using parameters used in data sets.
57
+
***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*, and *between*.
***Set name:** This type of filtering applies to non-sequential data sets. Here, the data sets are filtered by their 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.
67
60
68
-
Refer to the below GIF on how to associate a test data profile to a test case
61
+
***Parameter:** This type of filtering applies to non-sequential data sets. Here, the data sets are filtered using parameters used in the data sets. Here, filter operations are using *Equals*, *Contains*, *Start With*, *Ends With*, *Is Empty*, and *Is Not Empty*.
69
62
70
-

63
+
###
71
64
65
+
3. Click **Create** or **Update** once the data driven is enabled.
66
+

72
67
73
-
---
74
-
75
-
## [Step 2: Use parameter names in test case](#step-2-use-parameter-names-in-test-case)
76
-
77
-
1. Back in your test cases, while creating test steps, click on *test data* and select *@|Parameter|* from the drop down as shown below:
68
+
[[info | NOTE:]]
69
+
| You can use **runtime variables** in **filter values** by entering **$|Washington, DC|**, where *Washington, DC* is a stored variable, as shown in the example above.
78
70
79
-

71
+
## **Use parameter names in test case**
80
72
81
-
2. Now an overlay will open with all available parameters in the data profile.
73
+
1. Click on **test data** and select **@|Parameter|** from the drop-down list when creating test steps in the test case.
74
+

82
75
83
-

76
+
2. An overlay screen will open, displaying all available parameters in the test data profile.
77
+

84
78
85
79
Now, your test case will use the parameter value from your test data profile.
86
80
87
-
Refer to the below GIF on how to use parameter names in test cases
88
-

81
+

89
82
90
83
---
91
84
92
-
## [Step 3: Run Data Driven Test Case](#step-3-run-data-driven-test-case)
85
+
## **Run Data Driven Test Case**
93
86
94
-
1. Click on Run Now on the top right corner and select the test machine/device details
95
-
96
-
2. Once the test run is complete you will get results for each of the data sets. Like in the screenshot below:
87
+
1. Click on **Run Now** in the top right corner, and the **Ad-hoc Run** screen will appear. Select the **test machine/device** and click **Run Now**.
97
88
89
+
2. Once the test run is complete you will get results for each of the data sets.
98
90

0 commit comments