zoukankan      html  css  js  c++  java
  • jmeter 常用内置变量

    1. vars   API:http://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterVariables.html

      vars.get("");

      vars.put("",XXX);

    2. log

      log.info("xxx");

    3.ctx   API:http://jmeter.apache.org/api/org/apache/jmeter/threads/JMeterContext.html

      ctx.getThreadNum()

    4.props 

      encoding = props.get("sampleresult.default.encoding");
      log.info("sampleresult.default.encoding="+encoding);

    5.prev  API:http://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html

    System.out.println(prev.getResponseCode());
    System.out.println(prev.getResponseDataAsString());
    prev.setResponseCode("222");
    System.out.println(prev.getResponseCode());
    prev.setResponseMessage("qiaoyeye你好");
    System.out.println(prev.getResponseMessage());
    prev.setResponseData("qiaoyeye你好","UTF-8");
    System.out.println(prev.getResponseDataAsString());
    System.out.println(${port});
    System.out.println(ctx.getThreadNum());

    1 log.info("内置变量");
    2 ipString = vars.get("ip");
    3 log.info("ipString="+ipString);
    4 vars.put("newip",ipString);
    5 log.info("newip="+vars.get("newip"));
    6 encoding = props.get("sampleresult.default.encoding");
    7 log.info("sampleresult.default.encoding="+encoding);
  • 相关阅读:
    条码解析的一片js
    再看.net本质(二)
    再看.net本质
    powerdesigner逆向导出oracle数据库结构显示备注
    powerdesigner逆向工程,从数据库导出PDM
    实现HTTP跳转到HTTPS
    opencart 模块开发详解
    Opencart 之 Registry 类详解
    OpenCart 之registry功用
    php+支付宝整合
  • 原文地址:https://www.cnblogs.com/linbo3168/p/9260514.html
Copyright © 2011-2022 走看看