Creating a Data Sink
Before working with subreport data sinks, you need to create a data sink test step.
Open the ReadyAPI Data Source tutorial project.
Right-click the
Data Source Loop
test step.Select Insert Step > Data Sink.
Specify a name for the new step.
Click OK.
The new step will appear in the test case.
Double-click the data sink in the Navigator panel.
On a data sink page, select Data Sink drop-down list.
in theClick
to add a new property for the data sink.
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, theFormattedAddress
,Type
andPlaceID
are copied from the response message, and Status is the script run result.To check if your data sink works correctly, switch to the test case page first.
Click
.
After the test run finishes, switch back to the data sink page.
Check the output in the data log below. It should look like the output in the following screenshot: