是否可以在JMeter中循环测试?

编程入门 行业动态 更新时间:2024-10-28 02:25:26
本文介绍了是否可以在JMeter中循环测试?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

因此,我将一个线程组设置为使用简单的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中循环测试?

本文发布于:2023-11-07 15:04:51,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566772.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:测试   JMeter

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!