I am doing dat driven testing in SOAP UI tool. I am using an excel sheet where I have placed data.I am fetching data in SOAP UI tool using DATASOURCE and DATASOURCE LOOP steps.I am able to do this successfully if the xml node had single value in the Request.

Example: xml node with single value

  <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"  xmlns:tem="http://tempuri.org/">
   <soap:Header/>
   <soap:Body>
      <tem:GetOrders>  
         <tem:externalOrderID>OME68491990</tem:externalOrderID>
      </tem:GetOrders>
   </soap:Bosdy>
 </soap:Envelope>

I am facing problem if the xml node had more than one values, example below had many values.

<soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope" xmlns:tem="http://tempuri.org/">
   <soap:Header/>
   <soap:Body>
      <tem:CreateOrders>
         <!--Optional:-->
         <tem:xml><![CDATA[<QuickOrderDS>   <QuickOrderDT>     <CustomerPalletGrouping>119764</CustomerPalletGrouping>     <TMLoadId>54034962</TMLoadId>     <OriginId>3536</OriginId>     <CustomerInvoiceReference1>20130500007</CustomerInvoiceReference1>     <ManufacturingFacilityID>3536</ManufacturingFacilityID>     <DestinationID>170077</DestinationID>     <DestinationName></DestinationName>     <DestinationAddress1>1000 WINDHAM PKWY</DestinationAddress1>     <DestinationAddress2></DestinationAddress2>     <DestinationCity>BOLINGBROOK</DestinationCity>     <DestinationState>IL</DestinationState>     <DestinationZip>60490-3507</DestinationZip>     <BillofLading>1</BillofLading>     <Weight>2360</Weight>     <Pieces>1628</Pieces>     <Pallets>2</Pallets>     <TransportationDueFrom>2014-05-04T00:00:00</TransportationDueFrom>     <TransportationDueThru>2014-06-05T00:00:00</TransportationDueThru>     <Event>AMEX 25701 D1</Event>     <Bundles>0</Bundles>     <Version>11</Version>     <ManufacturingJobNo>25701</ManufacturingJobNo>     <CORPORATENUMBER>0000697364</CORPORATENUMBER>     <BILLTONUMBER>00012</BILLTONUMBER>     <ReShipID>0</ReShipID>     <DateDriver>C</DateDriver>     <ServiceType>Dropship</ServiceType>     <CommodityTypeId>5</CommodityTypeId>     <ModifiedUserId>NA\cg019647</ModifiedUserId>     <Containerization>Trays on Pallets</Containerization>     <ContentOwnerID>128</ContentOwnerID>     <ContentID>4205</ContentID>     <RRDLProcessingCF>8</RRDLProcessingCF>     <CustomerConsigneeName>Mail Service</CustomerConsigneeName>   </QuickOrderDT></QuickOrderDS>]]></tem:xml>
         <tem:partialCommit>true</tem:partialCommit>
      </tem:CreateOrders>
   </soap:Body>
</soap:Envelope>

Can anyone please help me how to proceed in this. How data driven testing is done in this case using excel sheet in soap ui?

1

There are 1 answers

3
SiKing On

This does not sound like much of a problem? Just use the same solution you used for your single value, and extend it.

If you want something different, then you have the following options:

  1. Use a whole bunch of property expansions in your SOAP call, something like: <tem:xml><![CDATA[<QuickOrderDS><QuickOrderDT><CustomerPalletGrouping>${datasource#prop1}</CustomerPalletGrouping><TMLoadId>${datasource#prop2}</TMLoadId>...</QuickOrderDT></QuickOrderDS>]]></tem:xml>
  2. You could use a Groovy step to create the entire input. This would be a little more involved, but would give you a little more control. See MarkupBuilder() here.
  3. You could create your entire input in Excel, and then just read that in as one value, and you are back to your single value solution.

Don't forget that in the SOAP message, everything inside the CDATA is essentially a string, even though to you it may look like XML. Only the receiving server interprets it as XML.