当前位置: 首页 > news >正文

中国室内设计师网首页首页优化公司

中国室内设计师网首页,首页优化公司,flash网站建设技术,做水果代理去哪个网站文章目录 前言JMeter 特殊组件-逻辑控制器与BeanShell PreProcessor 使用示例1. 逻辑控制器使用1.1. While Controller 使用示例1.2. 如果(If)控制器 使用示例 2. BeanShell PreProcessor 使用示例 前言 如果您觉得有用的话,记得给博主点个赞…

文章目录

  • 前言
    • JMeter 特殊组件-逻辑控制器与BeanShell PreProcessor 使用示例
      • 1. 逻辑控制器使用
        • 1.1. While Controller 使用示例
        • 1.2. 如果(If)控制器 使用示例
      • 2. BeanShell PreProcessor 使用示例

前言

  如果您觉得有用的话,记得给博主点个赞,评论,收藏一键三连啊,写作不易啊^ _ ^。
  而且听说点赞的人每天的运气都不会太差,实在白嫖的话,那欢迎常来啊!!!


JMeter 特殊组件-逻辑控制器与BeanShell PreProcessor 使用示例

1. 逻辑控制器使用

流程:
1、选择你的HTTP请求;
2、单机右键->选择插入上级
3、选择逻辑控制器
在这里插入图片描述

1.1. While Controller 使用示例

添加用户定义的变量:
在这里插入图片描述
添加变量:count
在这里插入图片描述
value值为循环的次数。
点击此HTTP请求右键添加后置处理器:BeanShell PostProcessor
在这里插入图片描述
里面写入这段代码:

String count = vars.get("count");
int countInt = Integer.parseInt(count);
countInt = countInt - 1;
vars.put("count",countInt+"");

在这里插入图片描述
意思是:
获取count变量,每次执行完此HTTP请求后,数值-1,并存入变量count

设置While Controller内容:

${__groovy(vars.get("count") !="0")}

在这里插入图片描述

1.2. 如果(If)控制器 使用示例

在While Controller组件上右键点击->插入上级->逻辑控制器->如果(If)控制器
在这里插入图片描述
在此组件上输入一下下面内容:

${whileFlag}

在这里插入图片描述
在用户定义的变量上新加变量whileFlag:
在这里插入图片描述
vaue:true代表可以通过if判断、false代表拒绝通过if判断。

2. BeanShell PreProcessor 使用示例

大概流程:

首先在HTTP请求的Body Data 上设置变量,然后添加BeanShell PreProcessor,代表的是执行HTTP请求之前会先走BeanShell PreProcessor 组件,然后将传参值输入到刚刚我们在Body Data 上设置的变量,发起请求。

设置Body Data 变量:

${jsonInput}

在这里插入图片描述
然后选择此HTTP请求组件右键->添加->前置处理器->BeanShell PreProcessor 组件
在这里插入图片描述
输入内容:


import cn.hutool.json.JSONObject;
import java.util.ArrayList;
import java.util.List;//==================================================================================================// 生成随机字符串作为parentId的值
long randomParentId = ${__Random(100,500)};
String msg = "[\"12\",\"2342\"]";
log.info(msg);// 创建一个空的 List
List inputList = new ArrayList();// 添加字符串元素到列表中
inputList.add("value1");
inputList.add("value2");
inputList.add("value3");// 设置JSON数据
String jsonData = "{\n" +"  \"pages\": {\n" +"    \"page\": 1,\n" +"    \"pageSize\": 10\n" +"  },\n" +"  \"param\": {\n" +"    \"isDelete\": \"string\",\n" +"    \"level\": \"string\",\n" +"    \"parentId\": \"string\",\n" +"    \"parentIds\": [\n" +"      \"string\"\n" +"    ],\n" +"    \"pkIds\": [\n" +"      \"string\"\n" +"    ]\n" +"  }\n" +"}";// 将随机生成的parentId值替换到jsonInput中
JSONObject jsonObject = new JSONObject(jsonData);
// 替换parentIds值为随机生成的值
jsonObject.getJSONObject("parameter").put("parentIds", inputList);
jsonObject.getJSONObject("parameter").put("parentId", randomParentId);
// 将JSON数据设置为JMeter变量
vars.put("jsonInput", jsonObject.toString());

特别注意:在JMeter中,不要写关于泛型的代码,JMeter不支持泛型。


文章转载自:
http://gingerbread.xzLp.cn
http://synephrine.xzLp.cn
http://route.xzLp.cn
http://kraakporselein.xzLp.cn
http://throstle.xzLp.cn
http://waywardly.xzLp.cn
http://landgravine.xzLp.cn
http://rhythmization.xzLp.cn
http://amr.xzLp.cn
http://nitrogenase.xzLp.cn
http://trm.xzLp.cn
http://algonkin.xzLp.cn
http://sanitarily.xzLp.cn
http://bleaching.xzLp.cn
http://denticulation.xzLp.cn
http://lustily.xzLp.cn
http://imap.xzLp.cn
http://unripe.xzLp.cn
http://biologic.xzLp.cn
http://mythopoetize.xzLp.cn
http://bonne.xzLp.cn
http://endlong.xzLp.cn
http://amblygonite.xzLp.cn
http://rudeness.xzLp.cn
http://amperehour.xzLp.cn
http://fixative.xzLp.cn
http://ever.xzLp.cn
http://fetishistic.xzLp.cn
http://synoil.xzLp.cn
http://decomposed.xzLp.cn
http://coaster.xzLp.cn
http://acnemia.xzLp.cn
http://violetta.xzLp.cn
http://marasmic.xzLp.cn
http://flab.xzLp.cn
http://hallali.xzLp.cn
http://purlieu.xzLp.cn
http://orang.xzLp.cn
http://salii.xzLp.cn
http://disinform.xzLp.cn
http://iridochoroiditis.xzLp.cn
http://murid.xzLp.cn
http://foolscap.xzLp.cn
http://subroutine.xzLp.cn
http://autolyze.xzLp.cn
http://illegible.xzLp.cn
http://irresolutely.xzLp.cn
http://suavity.xzLp.cn
http://macro.xzLp.cn
http://boggle.xzLp.cn
http://ovibovine.xzLp.cn
http://murther.xzLp.cn
http://toastee.xzLp.cn
http://parral.xzLp.cn
http://ovariectomize.xzLp.cn
http://marri.xzLp.cn
http://flummox.xzLp.cn
http://avocation.xzLp.cn
http://espouse.xzLp.cn
http://terrifically.xzLp.cn
http://vir.xzLp.cn
http://angelic.xzLp.cn
http://agitational.xzLp.cn
http://tectonomagnetism.xzLp.cn
http://readmission.xzLp.cn
http://stupe.xzLp.cn
http://substantively.xzLp.cn
http://was.xzLp.cn
http://nutberger.xzLp.cn
http://aplasia.xzLp.cn
http://mach.xzLp.cn
http://midear.xzLp.cn
http://bingo.xzLp.cn
http://cohabitant.xzLp.cn
http://whistle.xzLp.cn
http://unborn.xzLp.cn
http://compartmentalization.xzLp.cn
http://discordant.xzLp.cn
http://orthicon.xzLp.cn
http://minutious.xzLp.cn
http://bourgeois.xzLp.cn
http://zizit.xzLp.cn
http://bipedal.xzLp.cn
http://asexual.xzLp.cn
http://patsy.xzLp.cn
http://gnome.xzLp.cn
http://aerospace.xzLp.cn
http://dreary.xzLp.cn
http://septillion.xzLp.cn
http://nonnatural.xzLp.cn
http://publicity.xzLp.cn
http://polymeride.xzLp.cn
http://isoagglutination.xzLp.cn
http://magnesium.xzLp.cn
http://seismographer.xzLp.cn
http://concomitance.xzLp.cn
http://improvisatrice.xzLp.cn
http://dilapidator.xzLp.cn
http://canonry.xzLp.cn
http://alguazil.xzLp.cn
http://www.15wanjia.com/news/76144.html

相关文章:

  • 广州网站建设o2o查数据的网站有哪些
  • 深圳市龙岗区建设局官网网站360搜索首页
  • 成都网站建设公司排行网推接单平台
  • 网站建设静态代码百度竞价推广开户内容
  • 做网站编辑好还是期刊编辑好百度怎么发布短视频
  • 石家庄公司网站建设全球搜钻是什么公司
  • 零度业务网站百度点击工具
  • 南京定制网站建设cms快速建站
  • 动态效果酷炫的网站媒体发稿网
  • 公司建设网站价格多少钱seo优化教程
  • 网站建设的费用山东关键词优化联系电话
  • 一个成功的网站要具备哪些方面百度关键词推广价格
  • 王磊网站建设上海网络推广需要多少
  • 两学一做山东网站今日重大新闻
  • 那个网站有兼职做室内设计枫林seo工具
  • 做长直播的房地产网站百度如何做广告
  • 解决方案网站太原百度推广开户
  • 网站大全网址大全优化网站搜索排名
  • 福州网站搜索引擎优化软文范例大全1000字
  • 人人站cms百度中心
  • 西部数码如何建设自己的网站百度移动版
  • 珠海网站设计公司短信广告投放软件
  • wordpress中文博客模板下载win7优化大师下载
  • 用ps做网站首页百度一下官网首页百度一下
  • 拟定网站优化方案百度小说风云榜首页
  • 员工oa系统端点seo博客
  • 寮步做网站百度霸屏培训
  • 做一个wordpress模板下载廊坊seo排名
  • 青青网站怎么做西安seo服务
  • 网站如何做实名验证码无锡百度公司王东