Forum Discussion

dilipgem's avatar
10 years ago

Issue- Datadriven test

Hi there,
I'm using Excel as a datasource and trying to parameterize SOAP Request & Assert the Response for uneven rows in the Excel? I'm using SOAPUI Pro 5.1.2 (trial version).The Request accepts a query string and Response returns multiple blocks of items.
I'm interested in validating only select items from each of the blocks in the response.


I’m trying to automate the following scenario. Here we try to pass data from ‘SearchString’ column from the datasheet as a parameter in the SOAP Request and Validate ‘AssertnumFound’, ‘Assert_ISTN’ and ‘Assert_side’ fields from the SOAP Response. Notice that the rows are uneven in the datasheet (for few columns).
How do we add a logic for the Loop to run only once for ‘SearchString ‘field (Request) and number of times the rows for Assert fields (Response)? I tried 'DataSource Option' which doesn't give consistent results.

Scenario:
SOAP Request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:mas="com.capxd.services.blotter/BlotterService" xmlns:com="com.capxd.services.blotter">
<soapenv:Header/>
<soapenv:Body>
<mas:getBlotterItems>
<!--Optional:-->
<mas:arg1>
<com:query>"SOAP client C"&lt;1M </com:query>
</mas:arg1>
</mas:getBlotterItems>
</soapenv:Body>
</soapenv:Envelope>


SOAP Response:

Validate that
Num found =3

Validate ISIN and side from response.
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
<soapenv:Body>
<ns0:getBlotterItemsResponse xmlns:ns0="com.capxd.services.blotter/BlotterService" xmlns="com.capxd.services.blotter" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ns0:masterBlotterResponse>
<status>OK</status>
<message>1 pages returned</message>
<result>
<pages>
<page>
<blotterItem>
<ISTN>XO0191374817</ISTN>
<side>SELL</side>
<status> Active </status>
</blotterItem>

<blotterItem>
<ISTN>IS912828NZ91</ISTN>
<side>SELL</side>
<status> Active </status>
</blotterItem>

<blotterItem>
<ISTN>PS78355HJR12</ISTN>
<side>BUY</side>
<status> Active </status>
</blotterItem>

<blotterItem>
<ISTN>KO78355HJR12</ISTN>
<side>SELL</side>
<status> Active </status>
</blotterItem>

</page>
</pages>
<numFound>3</numFound>
</result>
</ns0:masterBlotterResponse>
</ns0:getBlotterItemsResponse>
</soapenv:Body>
</soapenv:Envelope>




Test Data Excel Sheet looks like this:

1 Reply