09 July 2009 - 3.0 |
Often you want save the data when doing Web Service testing. This can be in to take a response and use it in later Requests, save info for logging purposes or even to actually populate a business database.
This can be done in soapUI by writing a Groovy script, but is simplified in soapUI Pro.
![]() |
|
soapUI Pro includes a specialized DataSink TestStep that greatly eases the task of saving of data collected during a test to an external storage. The following DataSink types are supported:
The DataSink editor is divided into 4 parts;
The list of Properties should contain those properties that will be passed to the configured Datasink, they are added/removed using the Add/Remove toolbar buttons. The DataSink dropdown selects the DataSink to use
The DataSink Options dialog is as follows:
The following settings are available:
Every time the TestCase execution flow passes the DataSink Step it will call the configured DataSink with the current property values. Values should have been previously set by either a Groovy script or a property transfer, or can alternatively contain a PropertyExpansion syntax.
It is possible to drag properties from the Navigator tree into the Properties table to either add new a new property containing a PropertyExpansion for the dragged property, or if dragged onto an existing propertys' value; to create a PropertyExpansion there instead.
The "Shared" option in the toolbar controls if the DataSink should be shared between threads during a LoadTest, meaning that all running threads will write (synchronized) to the same DataSink instead of each creating their own.
The JDBC DataSink has the following configuration panel:
There are 5 available options pretty straight forward, with buttons for using wizard for configuring them, and for testing if properly configured:
The JDBC DataSink has the following configuration panel:
Configuration options are pretty much the same as for JDBC DataSink except that here JDBC Connection set on project level is used instead of configuring driver/connection string for this particular data sink.
The Excel DataSink has the following configuration panel:
The 4 available options are pretty straight-forward:
The File DataSink has the following configuration panel:
Files will be written in a simple row format, using the specified separator. The available options are:
The Groovy DataSink has the following configuration panel:
This step allows any kind of DataSink to be created for a DataSink Step. Available context variables are:
The Property DataSink has the following configuration panel:
This step allows for aggregation of values into a property that can be used elsewhere:
As seen in the example screenshot, property-expansion is supported in these fields. The example will continously "build" an XML list of items which can for example be used in a later request by referring to the DataSinks "test" property.
The SubReport DataSink collects data and exposes it to generated reports:
The configuration panel shows a read-only table containing data currently written to the DataSink. The data is made available to reports as a Data Export DataSet and as JRDataSource parameters named as the DataSink step, both for TestCase reports and LoadTest reports if the DataSink is set to be shared between threads.