JMeter入门 – One|Piece

  • 下载及安装
  • 环境需求
  • 样例:使用JMeter验证接口请求的返回内容
    •  从http://zzk.cnblogs.com中搜索1,验证结果页面中是否存在内容:够不断地输出0
    • 请求接口:http://zzk.cnblogs.com/s?w=1&t=b
  • 步骤
    •  新增“线程组”,命名:请求内容验证
      • 其它选项采用默认
    •  线程组内新增“Sampler–HTTP请求”,命名:请求内容
      • 服务器名称或IP:zzk.cnblogs.com
      • 路径:/s?w=1&t=b
      • 其它选项采用默认
    • 在HTTP请求中新增“断言–响应断言”,命名:内容断言验证
      • 在“要测试的模式”中点击“添加”,在新出现的一行中输入“够不断地输出0
      • 其它选项采用默认

 

截止以上步骤,”请求内容验证”功能已完成。点击界面中“启动”按钮,JMeter运行正常。日志信息:

2015/08/06 20:07:14 INFO – jmeter.util.BSFTestElement: Registering JMeter version of JavaScript engine as work-round for BSF-22
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Cannot find .className property for htmlParser, using default
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/html is
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xhtml+xml is
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for application/xml is
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/xml is
2015/08/06 20:07:15 INFO – jmeter.protocol.http.sampler.HTTPSamplerBase: Parser for text/vnd.wap.wml is org.apache.jmeter.protocol.http.parser.RegexpHTMLParser
2015/08/06 20:07:15 INFO – jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.control.gui.WebServiceSamplerGui
2015/08/06 20:07:15 INFO – jmeter.gui.util.MenuFactory: Skipping org.apache.jmeter.protocol.http.modifier.gui.ParamModifierGui
2015/08/06 20:07:15 INFO – jorphan.exec.KeyToolUtils: keytool found at ‘keytool’
2015/08/06 20:07:15 WARN – jmeter.protocol.http.proxy.ProxyControl: HTTP(S) Test Script Recorder SSL Proxy will use keys that may not work for embedded resources in file /Users/yjshi/Downloads/apache-jmeter-2.13/bin/proxyserver.jks
2015/08/06 20:07:15 INFO – jmeter.samplers.SampleResult: Note: Sample TimeStamps are START times
2015/08/06 20:07:15 INFO – jmeter.samplers.SampleResult: sampleresult.default.encoding is set to ISO-8859-1
2015/08/06 20:07:15 INFO – jmeter.samplers.SampleResult: sampleresult.useNanoTime=true
2015/08/06 20:07:15 INFO – jmeter.samplers.SampleResult: sampleresult.nanoThreadSleep=5000
2015/08/06 20:10:31 INFO – jmeter.services.FileServer: Default base=’/Users/yjshi’
2015/08/06 20:10:31 INFO – jmeter.services.FileServer: Set new base=’/Users/yjshi/Desktop’
2015/08/06 20:10:31 INFO – jmeter.save.SaveService: Testplan (JMX) version: 2.2. Testlog (JTL) version: 2.2
2015/08/06 20:10:31 INFO – jmeter.save.SaveService: Using SaveService properties file encoding UTF-8
2015/08/06 20:10:31 INFO – jmeter.save.SaveService: Using SaveService properties file version 1656252
2015/08/06 20:10:31 INFO – jmeter.save.SaveService: Using SaveService properties version 2.8
2015/08/06 20:10:31 INFO – jmeter.save.SaveService: All converter versions present and correct
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: Listeners will be started after enabling running version
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: To revert to the earlier behaviour, define jmeterengine.startlistenerslater=false
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: Running the test!
2015/08/06 20:10:31 INFO – jmeter.samplers.SampleEvent: List of sample_variables: []
2015/08/06 20:10:31 INFO – jmeter.samplers.SampleEvent: List of sample_variables: []
2015/08/06 20:10:31 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(true,*local*)
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: Starting ThreadGroup: 1 : Thread Group
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: Starting 1 threads for group Thread Group.
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: Thread will continue on error
2015/08/06 20:10:31 INFO – jmeter.threads.ThreadGroup: Starting thread group number 1 threads 1 ramp-up 1 perThread 1000.0 delayedStart=false
2015/08/06 20:10:31 INFO – jmeter.threads.JMeterThread: jmeterthread.startearlier=true (see jmeter.properties)
2015/08/06 20:10:31 INFO – jmeter.threads.JMeterThread: Running PostProcessors in forward order
2015/08/06 20:10:31 INFO – jmeter.threads.ThreadGroup: Started thread group number 1
2015/08/06 20:10:31 INFO – jmeter.engine.StandardJMeterEngine: All thread groups have been started
2015/08/06 20:10:31 INFO – jmeter.threads.JMeterThread: Thread started: Thread Group 1-1
2015/08/06 20:10:31 INFO – jmeter.protocol.http.sampler.HTTPHCAbstractImpl: Local host = CNyjshi.local
2015/08/06 20:10:31 INFO – jmeter.protocol.http.sampler.HTTPHC4Impl: HTTP request retry count = 0
2015/08/06 20:10:31 INFO – jmeter.protocol.http.sampler.HTTPHC4Impl: Setting up HTTPS TrustAll scheme
2015/08/06 20:10:31 INFO – jmeter.util.JsseSSLManager: Using default SSL protocol: TLS
2015/08/06 20:10:31 INFO – jmeter.util.JsseSSLManager: SSL session context: per-thread
2015/08/06 20:10:32 INFO – jmeter.threads.JMeterThread: Thread is done: Thread Group 1-1
2015/08/06 20:10:32 INFO – jmeter.threads.JMeterThread: Thread finished: Thread Group 1-1
2015/08/06 20:10:32 INFO – jmeter.engine.StandardJMeterEngine: Notifying test listeners of end of test
2015/08/06 20:10:32 INFO – jmeter.gui.util.JMeterMenuBar: setRunning(false,*local*)

 

为了完善JMeter的报告内容,再添加对应的“监听器”


  • 新增“监听器”–“察看结果树”、“聚合报告”、“断言结果”,三项内容均添加(常用的监听器模块)
  • 再次点击“启动”按钮,刚添加的监听器中会有对就应的结果输出
    • “察看结果树”【请求的具体结果及内容】:可查看具体的“取样器结果”、“请求”、“响应数据”(可查看HTTP请求是否正常通过)
    • “聚合报告”【聚合统计的结果报告】:针对本次启动的执行结果的聚合统计报告,包括请求时间、吞吐量、错误率(写报告时可以从这里取数据)
    • “断言结果”【针对所有断言的结果报告】:针对本次启动中所涉及到的所有断言结果(通过与否)

本文链接:JMeter入门,转载请注明。



You must enable javascript to see captcha here!

Copyright © All Rights Reserved · Green Hope Theme by Sivan & schiy · Proudly powered by WordPress

无觅相关文章插件,快速提升流量