jmeter-beanShell之prev类

  • Post author:
  • Post category:其他


  • prev 提供对当前取样器结果的访问能力
  • prev 映射 org.apache.jmeter.samplers 的 SampleResult 类
  • 官方文档: https://jmeter.apache.org/api/org/apache/jmeter/samplers/SampleResult.html
failMsg += "\n数据类型:" + prev.getDataType();
failMsg += "\n请求头信息:" + prev.getRequestHeaders();
failMsg += "\n响应头信息:" + prev.getResponseHeaders();
failMsg += "\n内容类型:" + prev.getContentType();
failMsg += "\n媒体类型:" + prev.getMediaType();
failMsg += "\n结果文件名:" + prev.getResultFileName();
failMsg += "\n接口请求结果:" + (prev.isSuccessful() ? "成功," : "失败,");
failMsg += "\n线程名称:" + prev.getThreadName();
failMsg += "\n请求名称:" + prev.getSampleLabel();
failMsg += "\n返回值:" + prev.getResponseCode();
failMsg += "\nmessage:" + prev.getResponseMessage();
failMsg += "\n接口:" + prev.getUrlAsString();
failMsg += "\n响应信息\n" + prev.getResponseDataAsString();



版权声明:本文为qq_40308101原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。