端点压力测试
Make stress test on endpoint
我是 soap 新手 Ui。
我的目标是使用soapui对端点进行压力测试。
我必须发出 post 请求 1000 次并在 json
中增加我的 ID 值
{
"Id": ${valueToIncrement}
}
你能提供一些信息来实现我的目标吗?
这应该可以解决您的问题:
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());
}
我是 soap 新手 Ui。 我的目标是使用soapui对端点进行压力测试。
我必须发出 post 请求 1000 次并在 json
中增加我的 ID 值{
"Id": ${valueToIncrement}
}
你能提供一些信息来实现我的目标吗?
这应该可以解决您的问题:
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());
}