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. vim之替换命令

    格式:<range>s /<pat1>/<pat2>/gc <range>用来指定替换命令执行的范围: 百分号(%)表示所有行 点(.)表示当前行 美元 ...

  2. InnoDB体系架构总结(二)

    事务 确保事务内的SQL都可以同步执行 要么一起成功 要么一起失败.事务有四个特性原子性 一致性,隔离性,持久性 实现方式 开始事务的时候回家记录记录一个LSN日志序列 当事务执行的时候 会首先在In ...

  3. git 常用命令及虚拟机服务器仓库搭建

    $ git config --global user.email "you@example.com" $ git config --global user.name "Y ...

  4. ASP.NET MVC中如何在当前页面上弹出另外一个页面

    注意:不是链接到另一个页面,而是弹出一个页面,当前的页面和弹出页面都存在于浏览器的同一个标签页中,效果如图: 弹出的窗体置于四大天王页面之上,但是无法继续操作底层的页面,代码如下: function ...

  5. spring的自动装配,骚话@Autowired的底层工作原理

    前言 开心一刻 十年前,我:我交女票了,比我大两岁.妈:不行!赶紧分! 八年前,我:我交女票了,比我小两岁,外地的.妈:你就不能让我省点心? 五年前,我:我交女票了,市长的女儿.妈:别人还能看上你?分 ...

  6. python基础学习笔记——模块

    自定义模块 我们今天来学习一下自定义模块(也就是私人订制),我们要自定义模块,首先就要知道什么是模块啊 一个函数封装一个功能,比如现在有一个软件,不可能将所有程序都写入一个文件,所以咱们应该分文件,组 ...

  7. Dell Omsa在Linux服务器上安装部署

    前言 本页详述了在一台Linux(RHEL6.4 x86_64)服务器上部署安装OMSA的通用做法,包括OMSA软件的获取方法和安装步骤. 演示环境: PowerEdge R620, RHEL 6.4 ...

  8. OSPF 提升 一 ----基础

    ospf  ccnp内容   一  link-state protocols      IGP   开放式的最短路径优先协议     公有协议 支持中到大型的网络    spf算法 链路状态协议 1. ...

  9. 转自kuangbin的AC自动机(赛前最后一博)

    有了KMP和Trie的基础,就可以学习神奇的AC自动机了.AC自动机其实就是在Trie树上实现KMP,可以完成多模式串的匹配.           AC自动机 其实 就是创建了一个状态的转移图,思想很 ...

  10. LINUX远程强制重启/proc/sys/kernel/sysrq /proc/sysrq-trigger

    1.     # echo 1 > /proc/sys/kernel/sysrq 2.     # echo b > /proc/sysrq-trigger 1. /proc/sys/ke ...