java - 对端点进行压力测试
问题描述
我是肥皂界面的新手。我的目标是使用soapui对端点进行压力测试。
我必须发出 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());
}
推荐阅读
- javascript - 对象破坏 ES6 类
- flutter - 我可以使用哪个小部件来拥有这样的图像?
- c# - 通过 C# 打开 Windows Powershell
- gremlin - 如何在 Gremlin 3.4.0 中返回顶点属性的元属性
- python - 如何向 OpenCV 函数 cv.dft() 输入复数值?
- swift - 如何在 Swift 中使用泛型更正实现提供者逻辑
- android - 如何在没有用户交互的情况下从我的应用程序读取安装在 android 设备中的 .pem 和 .p12 证书
- mysql - 删除表/数据库时仍然错误“定义了多个主键”
- rust - 在 `#![no_std]` 模式下是否可以解除恐慌?
- html - 当片段标识符已在 URL 中使用时,如何指向锚点?