因此,我将一个线程组设置为使用简单的HTTP采样器运行30秒.基本上,测试只是将GET请求发送到HTTP服务器30秒.
So I have a thread group set to run for 30 seconds with simple HTTP sampler. Basically the test just sends a GET request to HTTP server for 30 seconds.
根据预定的时间量,一旦完成相同的测试,是否有可能再次重新启动它.所以说我想让测试重新运行5次...
Is it possible to have the same test restart again once it has finished based on a predetermined amount of times. So say i want the test to rerun itself 5 times...
推荐答案选项1:
可以使用Run Time Controller.
我假设您已经在线程组"调度程序中设置了30秒的持续时间.
I assume you have set the 30 seconds duration in the Thread Group scheduler.
按如下所示更改测试计划.
Change the test plan as given below.
- 线程组-循环计数应为5(不应重复任何次数)
- 添加Run time controller-秒应为30
- 将所有采样器以及其他控制器(无论您在线程组下拥有什么)移到Run time controller下.
- Thread Group - loop count should be 5 (no of times should be repeated)
- Add a Run time controller - seconds should be 30
- Move all the samplers, other controllers (whatever you had under the Thread Group) under the Run time controller.
现在,此设置将运行5次测试-每次运行30秒.
Now this setup will the run the test 5 times - for 30 seconds each time.
选项2:
如果您以Non-GUI模式运行测试,则可以使用bat/sh文件来一次又一次地循环运行同一测试.
You can use a bat/sh file to rerun the same test again and again in a loop if you are running the test in Non-GUI mode.
更多推荐
是否可以在JMeter中循环测试?
发布评论