Jmeter 初识二 TestFragment使用记载

本文介绍了如何使用JMeter的TestFragment、Module Controller和Include Controller进行代码复用。通过创建TestFragment来处理登录获取token的操作,并在其他脚本中通过Include Controller引用,结合Module Controller实现动态替换测试片段。同时,利用Once Only Controller确保token只获取一次。
摘要由CSDN通过智能技术生成

TestFragment 顾名思义,碎片化的处理方式 。 它通常和module 一起使用。

官方介绍:http://jmeter.apache.org/usermanual/test_plan.html#logic_controller

 

The Test Fragment element is a special type of controller that exists on the Test Plan tree at the same level as the Thread Group element. It is distinguished from a Thread Group in that it is not executed unless it is referenced by either a Module Controller or an Include_Controller.

This element is purely for code re-use within Test Plans.

So , 因为登陆获取token的操作 , 以及后期 获取处理task的操作 比较频繁,所以我们使用了TestFragment , moduleController ,Include_Controller 组合使用。

以在登陆操作中的使用为例ÿ

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值