Setup and Teardown Thread Group in Jmeter
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的更多相关文章
- Jmeter 在什么情况下定义多个thread group?
Jmeter里面有三种线程组:setUp thread group, TearDown thread group, thread group. 如果想定义100个用户登录系统,60个用户做A操作,40 ...
- Jmeter之性能压测Stepping Thread Group 逐步增加并发数 阶梯式加压并发 (十五)
前段时间有描述过性能的测试类型 配置负载 Big Bang: 负载同时产生 Ramp up: 开始时候产生一定负载,然后每隔一段时间增加一些负载直到达到目标负载,这是典型模式 Ramp-up (wit ...
- JMeter Concurrency Thread Group阶梯式加压
初始使用,做了下总结 1.首先下载Concurrency Thread Group并发线程组插件,选择或者搜索Custom Thread Groups: 下载完成之后,JMeter会自动重启. 2.在 ...
- Jmeter Thread Group中如果存在HTTP request执行失败,就对整个Thread Group重新执行,限定最大执行次数N次
由于在对WEB系统进行自动化测试的过程中,经常会由于握手连接断开等原因导致HTTP请求发送失败,如果重新执行一次,会是成功的.在每天的自动化冒烟测试过程中,生成在测试报告存在误报,严重浪费了测试人员确 ...
- JMeter Ultimate Thread Group阶梯式减压
选择或者搜索Stantard Set标准集, 我们要用的Ultimate Thread Group最终线程组包含在里面: 下载完成之后,JMeter会自动重启. 添加最终线程组: 还是以打开博客园首页 ...
- JMeter中Ultimate Thread Group插件使用
JMeter下载地址: http://jmeter.apache.org/Ultimate Thread Group插件下载地址: https://jmeter-plugins.org/get/ 一 ...
- JMeter 线程组之Stepping Thread Group插件介绍
线程组之Stepping Thread Group插件介绍 by:授客 QQ:1033553122 测试环境 apache-jmeter-2.13 插件: https://jmeter-plu ...
- Jmeter(三十三)Stepping Thread Group
碰巧最近在做性能测试,就记一下Jmeter的第三方插件Stepping Thread Group. 具体一些插件信息,可以去:jmeter-plugins.org去进行下载. 该插件目前是已经被弃用的 ...
- jmeter之 jp@gc - Stepping Thread Group
1. 安装好插件 参考文档“扩展Jmeter插件获取更多监听器” 2. 添加线程组 右键测试计划->添加->Threads(Users)->jp@gc - Stepping ...
随机推荐
- 在centos7中为php7安装redis扩展
在此之前一直是用php5.6,安装redis也没遇到啥问题,嗖嗖的就安装上了 更新php版本到php7后,编译的时候报错 include <ext/standard/php_smart_str. ...
- docker:安装redis
文章来源:https://www.cnblogs.com/hello-tl/p/9239474.html 1.添加镜像 # docker pull redis:4.0 2.在/data下新建文件夹re ...
- 【C#】【数据结构】002-线性表:单链表
C#数据结构:单链表 1.自定义单链表结构: 单链节点类 using System.Collections; using System.Collections.Generic; using Unity ...
- Loadrunner中web脚本转成JavaVuser脚本
先用web方式录制好脚本,进行参数化,关联验证等操作,之后执行以下步骤: 1)将要转换的web脚本复制出来并保存到web.txt中2)参数界定符部分需要由{}手动修改成<>,包括参数化的和 ...
- 00030_ArrayList集合
1.数组可以保存多个元素,但在某些情况下无法确定到底要保存多少个元素,此时数组将不再适用,因为数组的长度不可变 2.JDK中提供了一系列特殊的类,这些类可以存储任意类型的元素,并且长度可变,统称为集合 ...
- 【js】--常用DOM库工具
/* 2014年3月16号 常用DOM工具库*/var DOM={}; DOM.getElesByClass=function (strClassName,context){ if(typeof st ...
- Visual Studio 2013 中使用断点
你可能已经很熟悉Visual Studio中的断点的基本功能.你在编辑器里代码的侧边点击,创建一个红色的圆点,然后运行应用程序,线程走到你所点的代码处停下,你可以用调试窗口查看代码状态. 你可能不熟悉 ...
- 【LeetCode】Valid Parentheses(有效的括号)
这道题是LeetCode里的第20道题. 题目要求: 给定一个只包括 '(',')','{','}','[',']' 的字符串,判断字符串是否有效. 有效字符串需满足: 左括号必须用相同类型的右括号闭 ...
- hdu2055
#include <stdio.h> int init(char a){ if(a>='a'&&a<='z'){ ); }; } int main(){ int ...
- 【JavaScript 6—基础知识点】:正则表达式(应用)
导读:其实,我不像大家一样,从一开始就重视着正则表达式,我甚至都觉得好浪费时间浪费精力,都没用的.因为,如果我要判断是不是为数字,我可以使用Numberic()方法,如果要去空格的话,使用trim() ...