Data Source Loop Test Step

Applies to ReadyAPI 3.40.1, last modified on June 29, 2022

About step

Use the Data Source Loop test step to perform test actions in a loop using new data on each iteration.

To use this test step, you need to add the following test steps to your test case:

  • Data Source Step – The Data Source test step that will provide access to the data.

  • Target Step – The test step that will perform test actions. This can be one of test steps sending requests like SOAP Request or REST Request, or the Run Test Case test step that runs another test case of your project.

The Data Source Loop test step will iterate through data and call all test steps contained in the loop on each iteration.

Requirements

To use this test step, you need a ReadyAPI Test license. If you do not have it, you can request it on our web site or start a trial.

Editing Data Source Loop test step

The test step has no editor. To modify its properties, simply double-click the test step in the project tree. This will invoke a dialog box with the following properties:

Data Source Step

Specifies the Data Source test step, from which the Data Source Loop test step will retrieve data.

Target Step

Specifies the test step from which the loop starts execution.

Discard PASS Results within Loop

Specifies whether ReadyAPI should discard all successful request results to use less memory in your tests. These results appear under each request’s record in the transaction log.

This option is identical to the Discard Successful Results test case option, but it affects only the steps inside the data source loop. If you need to review results for requests inside the loop, we recommend using the Discard PASS Results within Loop option over the one available for the test case.

Tip: ReadyAPI determines whether the request has been successful by validating it using the assertions of Target Step. If the step does not include any assertions, ReadyAPI saves all run results.

You can set the default option value in Preferences > Default Test Case Options.

Both Data Source Step and Target Step specify the test steps that belong to the same test case, to which the Data Source Loop test step belongs.

Property list

Also, you can adjust the test step’s behavior by using its properties in the Data Source Loop Properties tab.

Note: The Data Source Loop test step does not support custom properties.
Name Description
Name

The test step’s name.

Description

Text describing the test step.

Data Source Step

Shows the specified Data Source test step.

Target Step

Shows the specified Target test step.

Remarks

Typically, you should put the Data Source Loop test step after the Data Source and Target test steps in your test case. That is, you have the following hierarchy:

  • Data Source
    • Target test step
  • Data Source Loop

The Data Source test step loads data in the memory and sets the data pointer to the first row. Then, the Target test step performs the test actions using the first row. The Data Source Loop operation first transfers the data pointer to the next row, and only then runs the Target test step.

Calling loop for multiple test steps

Another example:

  • Data Source
    • Target test step
    • Property Transfer
  • Data Source Loop

This shows how to make the data source loop call multiple test steps. To do that:

  1. Put the target test step right after the Data Source test step.
  2. Position other test steps after the target test step and before the Data Source Loop test step.

In this example, the Property Transfer will be executed once for each iteration, using the Target test step for each data row. In fact, it works as if you had multiple copies of the Target test step and the Property Transfer.

After the loop is over, ReadyAPI will continue with the test steps that are after the Data Source Loop.

See Also

Data Source Test Step
Test Steps
Data-Driven Testing Tutorials

Watch the video
 
Highlight search results