我想用以下规范开发JMeter 5测试计划:
首先调用HTTP。如果来自A的状态代码不是200,则继续重复调用A,直到状态代码为200。第一次成功调用A之后,继续调用Rest。
有CSV数据集Config for API,它读取CSV文件,CSV中的每个条目调用API。当到达EOF时,JMeter必须自动退出(停止运行)。
API A必须每10分钟调用一次,而API b仍在被调用(或者JMeter仍在运行处理CSV文件)。
如何实现这一目标?2线程组是必需的,还是单线程组可以完成工作?
请提供详细信息,如测试计划和线程组应该是什么,JMeter元素的顺序,如what等等。
测试计划的目的是负载测试API B,因此多个线程可以调用API B,而单个线程可以调用API A。
发布于 2022-11-20 07:56:20
- Add a [While Controller](https://www.blazemeter.com/blog/while-controller-jmeter) and use the following [\_\_groovy() function](https://jmeter.apache.org/usermanual/functions.html#__groovy) as the condition:
${__groovy((vars.get('code') ?:42)为int != 200 )}
- Add your HTTP Request for API A as a child of the While Controller
- Add Boundary Extractor as a child of the HTTP Request and configure it like:
- Add [Flow Control Action](https://jmeter.apache.org/usermanual/component_reference.html#Flow_Control_Action) sampler and configure it to sleep for 600000 milliseconds either inside the While loop or outside depending on your scenario
https://stackoverflow.com/questions/74495457
复制相似问题