For loop is used to repeat the test steps for the selected test data profile with multiple data sets(inputs). There can be multiple steps and If-Else groups inside the For loop.
Let’s see a test case to understand this further.
For Loop Example
Let us start the Test Case with a simple Go to step. As the next test step, select the Test Step Type as “For Loop” to add For loop in the next Test Step.
Click on the Create button.
The For Loop group will be created and displayed as shown below.
Here [Registration data Profile] is the selected test data profile and [1-3] denotes the For loop start and loop end.
Click on the Add After button and add a Test Step. Let us input some value in the search field. Use the grammar, “Enter test data in the searchbox field”.
Delete the test data part. This will show a suggestions dropdown. Choose @|Parameter| from the suggestion.
Another suggestion dropdown with the test data name(s) as provided in the Test Data profile will appear now. Since I added just one test data value in the selected test data profile, only that one selection comes up.
Select the test data from the dropdown and click Create.
Run this test and the results page will show all the 3 iterations of the For loop group.
This is how we use For loop in Testsigma.
Please feel free to reach out at email@example.com or leave us a message on chat 🙂