使用Jmeter测试Webservice简单示例
2016-05-01 15:00
411 查看
1、webservice
先简单开发webservice,参考文档
http://www.cnblogs.com/xwdreamer/archive/2011/12/07/2296914.html
webservice没有打成war包,是在eclipse运行测试(这块有时间补充)
2、Jmeter
2.1 创建线程组(setUp Thread Group)
2.2 在线程组下创建取样器(SOAP/XML-RPC Request)
1)设置URL(wsdl路径):http://localhost:8080/WebServiceProject/services/CalculateService?wsdl
2)SOAP/XML-RPC Data(这块可以在ie运行wsdl中取),下图
点击Type为SOAP的Name,如: CalculateServiceSoap11Binding ,点击plus(加法),出现下图
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638063852.jpg)
输入x,y值,点击go
在右下框的status看到结果,点击source,取SOAP Request Envelope(为这个,绕了半天)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://wstest.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:plus>
<q0:x>${a1}</q0:x>
<q0:y>${a2}</q0:y>
</q0:plus>
</soapenv:Body>
</soapenv:Envelope>
2.3 添加监听器:察看结果树
运行该脚本,一个简单的webservice如何在Jmeter中运行完成
脚本增强,参数化
添加元件:CSV Data Set Config
filename:数据文件路径
variable Name:参数名(多个参数使用逗号分开,)
参数化设置图
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638174640.jpg)
数据文件
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638201740.jpg)
转载地址:http://www.spasvo.com/ceshi/open/kyxncsgj/Jmeter/201596103754.html
先简单开发webservice,参考文档
http://www.cnblogs.com/xwdreamer/archive/2011/12/07/2296914.html
webservice没有打成war包,是在eclipse运行测试(这块有时间补充)
2、Jmeter
2.1 创建线程组(setUp Thread Group)
2.2 在线程组下创建取样器(SOAP/XML-RPC Request)
1)设置URL(wsdl路径):http://localhost:8080/WebServiceProject/services/CalculateService?wsdl
2)SOAP/XML-RPC Data(这块可以在ie运行wsdl中取),下图
点击Type为SOAP的Name,如: CalculateServiceSoap11Binding ,点击plus(加法),出现下图
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638063852.jpg)
输入x,y值,点击go
在右下框的status看到结果,点击source,取SOAP Request Envelope(为这个,绕了半天)
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:q0="http://wstest.com" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<soapenv:Body>
<q0:plus>
<q0:x>${a1}</q0:x>
<q0:y>${a2}</q0:y>
</q0:plus>
</soapenv:Body>
</soapenv:Envelope>
2.3 添加监听器:察看结果树
运行该脚本,一个简单的webservice如何在Jmeter中运行完成
脚本增强,参数化
添加元件:CSV Data Set Config
filename:数据文件路径
variable Name:参数名(多个参数使用逗号分开,)
参数化设置图
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638174640.jpg)
数据文件
![](http://www.spasvo.com/ckfinder/userfiles/images/2015090638201740.jpg)
转载地址:http://www.spasvo.com/ceshi/open/kyxncsgj/Jmeter/201596103754.html
相关文章推荐
- PHP基础之进制的转换
- secureCRT光标不见啦
- POJ 3321Apple Tree(dfs序 树状数组)
- ios拼图游戏(三)之使用TableView布局
- leetcode——117——Populating Next Right Pointers in Each Node II
- Unity Official Tutorial --- CREATING A BREAKOUT GAME FOR BEGINNERS
- SNMP++ 01-SNMP request time out问题的解决
- 1371 - Energetic Pandas
- NSUrSession和AFN
- PC SDK PDFs
- Poj 1428 Children's Dining【哈密顿路径】
- [从头学声学] 第201节 乐器的频率
- Android 在开发中使用单元测试
- 科学开缸、轻松养鱼
- handler和asyncTask比较
- 养鱼“好水”的定义
- 为ListView添加Ripple效果
- OpenCV使用迭代器对像素进行快速操作
- linux下安装安装pcre-8.32 configure: error: You need a C++ compiler for C++ support
- ASP.NET 状态管理(cookie、Session)