setup和teardown有点类似于每个测试用例开始和结束时要做的动作

A Thread Group is the starting point of any Jmeter Test Plan. All the elements of a Test plan must be defined under Thread Group. In simple words, a thread group stores the configuration required for Jmeter script execution. Jmeter also provides feature to configure Setup Thread Group and TearDown Thread Group.

In this article we will discuss about the purpose and benefits of having Setup Thread Group and TearDown Thread Group.

If you are new to Jmeter and want to understand more about Thread Group, please click here: 5 must know features of Thread Group in Jmeter.

Setup Thread Group:

It is a special form of Thread Group used to perform necessary actions before execution of regular thread group starts. Behavior of threads mentioned under Setup Thread Group is exactly same as normal thread group.

Purpose of having Setup Thread Group is to distinguish all pre-test actions from the normal thread group so they can be performed before the actual test execution starts. Jmeter automatically triggers Setup Thread group before normal one.

Example:

1) Import amount of Data from Database and store them into variables.
2) Create / Register multiple users to be used in Test Thread Group.

TearDown Thread Group:

It is a special form of Thread Group used to perform necessary actions after the execution of regular thread group completes. Behavior of threads mentioned under Setup Thread Group is exactly same as normal thread group.

Use of TearDown Thread Group is to differentiate all the post-test actions which are required to run once the execution of normal thread group is over. Jmeter will automatically trigger TearDown Thread Group after execution of regular thread group completes.

Note:

By default, TearDown Thread Group won’t run if the Test is completed as expected. If you want to run it anyway, mark the check-box “Run tearDown Thread Groups after shutdown of main threads” from Test Plan element.

Example:

1) Delete Users which were created in beginning of the test.

How to Add?

To add Setup and TearDown Thread Groups: Right Click on Test Plan > Add > Threads(User) > setUp Thread Group / tearDown Thread Group.

Let us know how you have used Setup and TearDown Thread Groups. Thank You & Happy Testing.

转载:http://www.testingjournals.com/setup-teardown-thread-group-jmeter/

Setup and Teardown Thread Group in Jmeter的更多相关文章

  1. Jmeter 在什么情况下定义多个thread group?

    Jmeter里面有三种线程组:setUp thread group, TearDown thread group, thread group. 如果想定义100个用户登录系统,60个用户做A操作,40 ...

  2. Jmeter之性能压测Stepping Thread Group 逐步增加并发数 阶梯式加压并发 (十五)

    前段时间有描述过性能的测试类型 配置负载 Big Bang: 负载同时产生 Ramp up: 开始时候产生一定负载,然后每隔一段时间增加一些负载直到达到目标负载,这是典型模式 Ramp-up (wit ...

  3. JMeter Concurrency Thread Group阶梯式加压

    初始使用,做了下总结 1.首先下载Concurrency Thread Group并发线程组插件,选择或者搜索Custom Thread Groups: 下载完成之后,JMeter会自动重启. 2.在 ...

  4. Jmeter Thread Group中如果存在HTTP request执行失败,就对整个Thread Group重新执行,限定最大执行次数N次

    由于在对WEB系统进行自动化测试的过程中,经常会由于握手连接断开等原因导致HTTP请求发送失败,如果重新执行一次,会是成功的.在每天的自动化冒烟测试过程中,生成在测试报告存在误报,严重浪费了测试人员确 ...

  5. JMeter Ultimate Thread Group阶梯式减压

    选择或者搜索Stantard Set标准集, 我们要用的Ultimate Thread Group最终线程组包含在里面: 下载完成之后,JMeter会自动重启. 添加最终线程组: 还是以打开博客园首页 ...

  6. JMeter中Ultimate Thread Group插件使用

    JMeter下载地址:  http://jmeter.apache.org/Ultimate Thread Group插件下载地址: https://jmeter-plugins.org/get/ 一 ...

  7. JMeter 线程组之Stepping Thread Group插件介绍

    线程组之Stepping Thread Group插件介绍   by:授客 QQ:1033553122 测试环境 apache-jmeter-2.13   插件: https://jmeter-plu ...

  8. Jmeter(三十三)Stepping Thread Group

    碰巧最近在做性能测试,就记一下Jmeter的第三方插件Stepping Thread Group. 具体一些插件信息,可以去:jmeter-plugins.org去进行下载. 该插件目前是已经被弃用的 ...

  9. jmeter之 jp@gc - Stepping Thread Group

    1.   安装好插件 参考文档“扩展Jmeter插件获取更多监听器” 2.   添加线程组 右键测试计划->添加->Threads(Users)->jp@gc - Stepping ...

随机推荐

  1. ubuntu下如何对接斗鱼直播

    参考教程:https://www.cnblogs.com/liuxuzzz/p/5315998.html 大神写得挺细的,这里都不想再多说了! 为啥要做这个呢?可能真的只是为了好玩吧!!有兴趣直播的孩 ...

  2. LeetCode(105) Construct Binary Tree from Preorder and Inorder Traversal

    题目 Given preorder and inorder traversal of a tree, construct the binary tree. Note: You may assume t ...

  3. JavaScript内建对象-String

    JavaScript中通过双引号或单引号界定一个字符串. String对象只有一个属性:length属性,得到字符串的长度. 处理字符串本身的方法 charAt(index) 返回字符串中index指 ...

  4. awk之NF的妙用

       在awk中大家都知道NF的作用,它是一个awk的内建变量,代表是每行的字段数量.常用的几种方式我给大家慢慢到来.最多的就是在读取每个字段内容 for(i=1;i<=NF;i++) 这个运用 ...

  5. Java设计模式学习二

    Java设计思想之单例模式 单例模式(Singleton Pattern)是Java中最常见的设计模式之一.这种类型的设计模式属于创建型模式,它提供了一种创建对象的最佳方式. 这种模式涉及到一个单一的 ...

  6. windows phone 网络开发三部曲(一)各种包的各种抓法

    首先感谢大家对我上一篇博客的支持,让我也体验了一把上榜的感觉. 这无疑是对我这个刚刚打算,认真写写博客的人的莫大的鼓励,再次感谢(鞠躬)!! 接下来想和大家分享一些关于windows phone网络开 ...

  7. mysql replication常见错误整理

    这篇文章旨在记录MySQL Replication的常见错误,包括自己工作中遇到的与网友在工作中遇到的,方面自己及别人以后进行查找.每个案例都是通过Last_IO_Errno/Last_IO_Erro ...

  8. Absolute(绝对定位)与relative(相对定位)的图文讲解

    Position的属性值有:1.     Absolute:绝对定位,是相对于最近的且不是static定位的父元素来定位 2.     Fixed:绝对定位,是相对于浏览器窗口来定位的,是固定的,不会 ...

  9. [uiautomator篇] bluetooth---接口来做

    package com.softwinner.performance.frameratetest; import android.Manifest; import android.bluetooth. ...

  10. 防火墙iptables介绍

    防火墙: netfilter/iptables是集成在Linux2.4.X版本内核中的包过滤防火墙系统.该架构可以实现数据包过滤,网络地址转换以及数据包管理功能.linux中防火墙分为两部分:netf ...