想提升测试效率?这个jmeter开发webserice协议的脚本必备!

想提升测试效率?这个jmeter开发webserice协议的脚本必备!

webserivice协议脚本开发

webserivice协议脚本开发的两种方式:

    1. HTTP请求
    2. 通过soap模板
    3. SOAP/XML-RPC Request(jmeter3.2之后已经不支持)
SOAP/XML-RPC Request请求

步骤:

1、测试计划

2、添加线程组

3、添加取样器,SOAP/XML

-RPC Request请求

地址:http://www.webxml.

***.***/WebServices/WeatherWebService.asmx?

op=getWeatherbyCityNam

URL:WeatherWebService Web 服务

soap/XML-RPC Data

http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">

soap12:Body

http://WebXml.***.***/">

深圳

HTTP请求方式开发webservice接口

网址:

Host: www.webxml.***.***

get请求:

URL:/WebServices/ChinaZipSearchWebService.asmx/getZipCodeByAddress?theProvinceName=广东&theCityName=深圳&theAddress=&userID=

post方式:

Host: www.webxml.***.***

Content-Type: application/x-www-form-urlencoded

URL:/WebServices/ChinaZipSearchWebService.asmx/getZipCodeByAddress

data:

theProvinceName=广东&theCityName=深圳&theAddress=&userID=

soap模板开发webservice协议脚本

分别介绍

用户自定义变量(user defined variables)

HTTP请求默认值(HTTP Request Defaults)

HTTP消息头管理器(HTTP Header Manager)

HTTP请求

URL:/WebServices/ChinaZipSearchWebService.asmx

data:

<?xml version="1.0" encoding="utf-8"?> <soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope"> <soap12:Body> <getZipCodeByAddress xmlns="http://WebXml.***.***/"> <theProvinceName>广东</theProvinceName> <theCityName>深圳</theCityName> <theAddress></theAddress> <userID></userID> </getZipCodeByAddress> </soap12:Body> </soap12:Envelope>

没有接口文档怎么获取报文信息

1、安装soapui工具,下载地址:SoapUI Latest Releases | SoapUI

2、新建soap 项目

转载请说明出处内容投诉
AJ教程_站长资源网 » 想提升测试效率?这个jmeter开发webserice协议的脚本必备!

发表评论

欢迎 访客 发表评论

一个令你着迷的主题!

查看演示 官网购买