Creating a Data Sink

Before working with subreport data sinks, you need to create a data sink test step.

  1. Open the ReadyAPI Data Source tutorial project.

  2. Right-click the Data Source Loop test step.

  3. Select Insert Step > Data Sink.

  4. Specify a name for the new step.

  5. Click OK.

    The new step will appear in the test case.

    ReadyAPI: The data sink test step in a test case
  6. Double-click the data sink in the Navigator panel.

  7. On a data sink page, select SubReport in the Data Sink drop-down list.

  8. Click add.png to add a new property for the data sink.

  9. Set up its properties as follows:

    Property

    Value

    CityName

    ${DataSource#City}

    FormattedAddress

    ${Geocode search#Response#//GeocodeResponse[1]/result[1]/formatted_address[1]}

    Type

    ${Geocode search#Response#//GeocodeResponse[1]/result[1]/type[1]}

    PlaceID

    ${Geocode search#Response#//GeocodeResponse[1]/result[1]/place_id[1]}

    Status

    ${=testRunner.results[testRunner.results.size()-1].status}

    As you can see, the CityName property copies the value from the data source, the FormattedAddress, Type and PlaceID are copied from the response message, and Status is the script run result.

  10. To check if your data sink works correctly, switch to the test case page first.

  11. Click run.png.

  12. After the test run finishes, switch back to the data sink page.

  13. Check the output in the data log below. It should look like the output in the following screenshot:

    ReadyAPI: The data sink after the test run

See Also

Publication date: