Make stress test on endpoint

I’m new in soap Ui.
My goal is to make stress test on endpoint using soapui.

i have to make post request 1000 times and Increment my id value in json

{
  "Id": ${valueToIncrement}
}

can u provide some info to achieve my goal, pls?

1
Leave a Reply

avatar
1 Comment threads
0 Thread replies
0 Followers
 
Most reacted comment
Hottest comment thread
1 Comment authors
Jason Recent comment authors
  Subscribe  
newest oldest most voted
Notify of
Jason
Guest

this should do the trick for you:

import org.json.JSONObject;

def testStep = context.testCase.getTestStepByName("TestStep");

for (int i = 0; i < 10; i++) {
    final String json = testStep.getPropertyValue("Request");

    final JSONObject obj = new JSONObject(json);
    obj.put("Id", i);

    testStep.setPropertyValue("Request", obj.toString());
    testRunner.runTestStepByName(testStep.getName());
}