Jmeter调用Webapi介绍

时间:2015-06-05 17:28:34   收藏:0   阅读:2953

一、介绍
    JMeter主要用于压力测试,使用Java编写,由Apache基金会管理
    官方网站:http://jmeter.apache.org/index.html
    下载地址:http://jmeter.apache.org/download_jmeter.cgi
    参考资料:
    WebApi测试:http://mobisoftinfotech.com/resources/blog/quality-assurance/web-api-performance-testing-using-apache-jmeter/
    Aggregate监控器:http://www.51testing.com/html/51/n-866351.html


二、启动Jmeter
    下载Jmeter后解压包,定位到bin目录下,运行jmeter.bat,弹出运行主界面
    
     运行Jmeter可能抛异常:‘findstr‘不是内部或外部命令 解决方法
     解决方法:系统环境变量 Path 新增   %SystemRoot%\system32;%SystemRoot%;(最前面要用;分号隔开)  


三、使用Jmeter测试asp.net webapi接口
1、新增线程组
技术分享
设置线程组参数
技术分享

2、新增HttpRequest: 在新增的线程组单击右键
技术分享

3、设置Http请求Url、请求方法、请求参数等
技术分享

4、设置Http请求头信息
技术分享

技术分享

5、新增性能监听器,查看性能指标
  a) Aggregate监控器:http://www.51testing.com/html/51/n-866351.html
技术分享
监控结果
技术分享
 b) View Results Tree:记录每次请求信息,成功用绿色表示,失败用红色表示
技术分享

c) Graph Results:图形化监听器

原文:http://www.cnblogs.com/gossip/p/4554989.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!