0

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?

mona
  • 151
  • 2
  • 2
  • 8

1 Answers1

0

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.

SiKing
  • 10,003
  • 10
  • 39
  • 90
  • can you please elaborate point #1 and #3 on how to implement it. I don't have knowledge on groovy script much – mona Nov 13 '14 at 09:05
  • What does your Excel source look like? – SiKing Nov 13 '14 at 15:14
  • its in general.. like first row column name and below that second row is the testdata/value to insert in xml. Please help me out how to proceed. How to fetch the data for CDATA xml from the excel sheet – mona Nov 14 '14 at 12:56