Forum Discussion

olekolek's avatar
olekolek
Member
7 years ago

Multiply insetning at one request

Dear team, 

I am a new at SoaPUI tool, but have one task. 

The task is to upload new clients with a help of simple request and I have to do it one by one, it is ok, for 1-10 clients but not for 20+ up to 230. So how can I do multiply uploading or running current script putting clients list at once? 

 

So in bold at the first part I have to put one by one client numbers, and it is ok for couple, but not for many.

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" *******************************">
<soapenv:Header/>
<soapenv:Body>
<****:SFData>
<!--Optional:-->
<PRID>675907</PRID>
</****:SFData>
</soapenv:Body>
</soapenv:Envelope>

 

 

here is in bold I get a system respond equally to customer number I've put it before at the request. 

 

<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Body>
<ns0:ServiceStatus xmlns:ns0="http://***************************">
<OverallStatus>Success</OverallStatus>
<StatusMessage>
<StatusMessageCode>0000</StatusMessageCode>
<StatusMessageDescription>Oracle Account Number:***** with Party ID:************** has been created successfully.</StatusMessageDescription>
</StatusMessage>
</ns0:ServiceStatus>
</s:Body>
</s:Envelope>

 

 

 

How can I improve this request for customer list? 

  • JHunt's avatar
    JHunt
    Community Hero

    Add your request to a TestCase. Right-click and Disable the TestRequest, since we'll run it by script instead it running as part of the test case. In the request body, replace the client number with a property expansion, as in:

     

    <PRID>${=context["clientNumber"]}</PRID>

    Add a new Groovy Script TestStep, and enter:

     

     

    [1,2,3].each {
        context["clientNumber"] = it
        testRunner.testCase.getTestStepByName("Request 1").run(testRunner,context)
    }

     

    Replace 1,2,3 with all your real client numbers, and replace "Request 1" with the name of the SOAP Request TestStep you created.

     

    Then run the TestCase.