Forum Discussion

johnnybegood's avatar
johnnybegood
New Contributor
6 months ago
Solved

SoupUI loop

I have an web service that will take 1 file at a time.  I have several thousand.

the SoapUI Request envelope looks like this and needs to be repeated when a different ClientID ( <tem:ClientID>?</tem:ClientID>) has been identified....

<tem:TransferProgram>
         <tem:SystemCode>?</tem:SystemCode>
         <tem:UserName>?</tem:UserName>
         <tem:Password>?</tem:Password>
         <tem:ProgramTransferInfo>
            <tem:DateOfTransfer>?</tem:DateOfTransfer>
            <tem:Program>?</tem:Program>
            <tem:Room>?</tem:Room>
            <tem:RoomAndBoardBillingCode>?</tem:RoomAndBoardBillingCode>
            <tem:TimeOfTransfer>?</tem:TimeOfTransfer>
            <tem:TypeOfTransfer>?</tem:TypeOfTransfer>
            <tem:Unit>?</tem:Unit>
         </tem:ProgramTransferInfo>
         <tem:ClientID>?</tem:ClientID>
         <tem:EpisodeNumber>?</tem:EpisodeNumber>
      </tem:TransferProgram>

How do i loop to restart the web service each time a unique ClientID is found?

1 Reply

  • Humashankar's avatar
    Humashankar
    Icon for Champion Level 3 rankChampion Level 3

    Hi johnnybegood 

    Begin by creating a DataSource step in your TestCase, configuring it to read ClientIDs from a file, such as a CSV or Excel document, and ensuring the ClientID column is properly mapped.

    • Next, add a DataSource Loop, placing it after the DataSource step, and configure it to utilize the created DataSource.
    • Within the loop, create a SOAP Request step, using property expansion to insert the ClientID, denoted as ${DataSource#ClientID}.
    • Finally, add a Groovy Script step at the end of the loop, employing a script to control the iteration.

    This setup enables the reading of ClientIDs from the DataSource, execution of the SOAP Request for each ClientID, and restarting of the loop until all ClientIDs are processed.

    Best Regards