在 JMeter 中按顺序运行多个线程组 [英] Running multiple Thread Groups sequentially in JMeter

查看:73
本文介绍了在 JMeter 中按顺序运行多个线程组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个测试计划,其中有多个线程组.
我想按顺序运行所有线程组.
线程组如下:

线程组1线程组2线程组3...线程组N

我在互联网上的不同博客和文章中读到过,人们声称线程组将按照定义的顺序运行,但显然在我的情况下不是这样.线程组 4 在线程组 1 之前运行.线程组 4 正在生成错误报告,因为它在线程组 1 之前运行.

我如何确保我的线程组的排序?

<小时>

另外,我需要实现以下场景:

  1. 单个用户多次运行单个请求(单个用户应从单个 HTTP 请求创建 1000 个帐户).

  2. 多个用户同时多次运行多个请求(多个用户应从单个 HTTP 请求同时创建 1000 个帐户).

怎么做?

PS:请在回复前仔细阅读并理解问题.

解决方案

关于测试计划中线程组的连续执行:简单勾选:

线程组线程数 = 1循环次数 = 1...循环控制器循环次数 = NHTTP 请求...

甚至没有循环控制器但不那么灵活的模式:

线程组线程数 = 1循环次数 = N...HTTP 请求...

  • 使用标准线程组的线程数属性和Ramp-Up Period属性:

    线程组线程数 = N上升期 = 0循环次数 = 1...HTTP 请求...

    这将启动 N 个同时执行相同场景的线程.

  • I have a Test plan in which there are multiple Thread Groups.
    I want to run all of the Thread Groups sequentially.
    Thread Groups are as below:

    Thread Group1
    Thread Group2
    Thread Group3
    . . .
    Thread GroupN
    

    I've read in different blogs and articles on the internet, people claiming that the thread groups will run in the order they are defined but apparently they are not in my case. Thread Group4 runs before Thread Group1. Thread Group4 is generating a report which is wrong because it runs before Thread Group1.

    How do I ensure the ordering of my Thread Groups?


    Also, I need to implement the following scenarios:

    1. Run a single request multiple time by a single user (Single user should create 1000 accounts from a single HTTP request).

    2. Run a multiple requests multiple times by multiple users simultaneously (Multiple users should create 1000 accounts simultaneously from a single HTTP request).

    How to do so?

    PS: Please read and understand the query carefully before replying.

    解决方案

    Concerning consecutive execution of thread groups in test plan: simple check Run Test Group consecutively check-box on the Test Plan configuration screen:


    1. Use e.g. Loop Controller for this:

      Thread Group
      Number of Threads = 1
      Loop Count = 1
        ...
        Loop Controller
        Loop Count = N
            HTTP Request
        ...
      

      or even schema without Loop Controller but not so flexible:

      Thread Group
      Number of Threads = 1
      Loop Count = N
        ...
        HTTP Request
        ...
      

    2. Use Number of Threads property of standard Thread Group for this together with Ramp-Up Period property:

      Thread Group
      Number of Threads = N
      Ramp-Up Period = 0
      Loop Count = 1
        ...
        HTTP Request
        ...
      

      This will start N simultaneous threads executing same scenario.

    这篇关于在 JMeter 中按顺序运行多个线程组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆