|
LR新手。今天对接口做性能测试,因为是接口的不知道怎么录制,实在有点无从下手。还请各位前辈们不吝指导,小女纸先行谢过~~
接口描述
XML方式:
接口格式采用基于HTTP协议,要求HTTP的版本为1.1及以上。请求方将数据封装成xml数据包,然后向接收方 提交该xml请求包, 服务器和客户端之间通过HTTP的POST方法来进行交互。
命令请求和响应的内容都放在Http请求Entity Body中,并采用XML格式,内容类型(Content-Type)为:“application/xml”,在HTTP的包头里面的表示为:“Content-Type: application / xml”。HTTP的包头需要包括”Content-Length”,填写值为http请求或者http响应的包体长度。
Xml的编码格式采用UTF-8,即<?xml version="1.0" encoding="UTF-8"?>
http Post提交的地址格式为:file:///C:\DOCUME~1\1302\LOCALS~1\Temp\%W@GJ$ACOF(TYDYECOKVDYB.pnghttp://118.194.161.122:80/service
本次测试使用的接口:接口名称:/appstore/huanwang/appclassessInterface
请求报文
<?xml version="1.0" encoding="utf-8"?>
<appClassesRequest>
<parameter>
<callid>1234567</callid>
<language>zh_CN</language>
<client>
<dnum>1232312</dnum>
<didtoken>1234323432432</didtoken>
<devmodel>TCL_ANDROID_2.1</devmodel>
<systemver>2.1</systemver>
</client>
<user>
<huanid>10995222</huanid>
<token>35464e54e564f</token>
</user>
</parameter>
<apiversion>3.0</apiversion>
</appClassesRequest>
我的脚本如下:
Action()
{
web_custom_request("Sample_Request",
"Method=POST",
"Resource=0",
"Referer=",
"Mode=HTTP",
"RecContentType=text/xml",
"EncType=text/xml; charset=utf-8",
"URL=http://118.194.161.122:80/service/appstore/huanwang/appclassessInterface",
"Body=<?xml version=\"1.0\" encoding=\"UTF-8\"?>"
"<appClassesRequest>"
"<parameter>"
"<callid>1234567</callid>"
"<language>zh_CN</language>"
"
<client>"
"
<dnum>1232312</dnum>"
"
<didtoken>1234323432432</didtoken>"
"
<devmodel>HUAN-FREE-APPSTORE</devmodel>"
"
<systemver>2.1</systemver>"
"
</client>"
"
<user>"
"
<huanid>10995222</huanid>"
"
<token>35464e54e564f</token>"
"
</user>"
"
</parameter>"
"
<apiversion>3.0</apiversion>"
"</appClassesRequest>",
"LAST");
return 0;
}
运行后结果如下:
Run Mode: HTML
[MsgId: MMSG-26000]
Run-Time Settings file: "C:\Documents and Settings\1302\Local Settings\Temp\noname12\\default.cfg"
[MsgId: MMSG-27141]
Ending action vuser_init.
Running Vuser...
Starting iteration 1.
Starting action Action.
Action.c(3): Error -26563: Non-empty response body is invalid with HTTP Status Code 204 (No Content) for "http://118.194.161.122:80/service/appstore/huanwang/appclassessInterface"
[MsgId: MERR-26563]
Action.c(3): web_custom_request("Sample_Request") highest severity level was "ERROR", 0 body bytes, 711 header bytes
[MsgId: MMSG-26388]
Ending action Action.
Ending iteration 1.
Ending Vuser...
Starting action vuser_end.
Ending action vuser_end.
Vuser Terminated.
烦请前辈们指点迷津~~小女纸线上等待,谢谢哈~ |
|