关于loadrunner录制发送http请求的几种脚本格式
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了关于loadrunner录制发送http请求的几种脚本格式相关的知识,希望对你有一定的参考价值。
1. 基于key/value格式,可参照下列格式:
web_submit_data("queryForeign.do",
"Action=http://10.3.1.91:9001/cms/queryForeign.do",
"Method=POST",
"RecContentType=text/plain",
"Referer=http://10.3.1.21:9001/pweb/welcome.do",
"Mode=html",
ITEMDATA,
"Name=FromUserName", "Value=234", ENDITEM,
"Name=ToUserName", "Value=sssss", ENDITEM,
LAST);
注意:RecContentType一定要是“text/plain”;
2. 基于json格式,可参照下列格式:
web_custom_request("eweb-common.Prepose.do",
"URL=http://10.0.161.156:8080/prepose/eweb-common.Prepose.do",
"Method=POST",
"Resource=0",
"RecContentType=application/json",
"Referer=http://10.0.161.9:8088/#/userLogin/login",
"Snapshot=t6.inf",
"Mode=HTML",
"EncType=application/json",
"Body={"Head":{"_MChannelId":"PFRT","_TransactionId":"eweb-common.EppRegistRsf","_locale":"zh_CN"},"Body":{"platFormCd":"YFB_PC","idType":"01","idNum":"320921199008134633","phone":"15852915190","mediAcctLevel":"2","authState":"1","sourceUserId":"123","verifyMtd":"OTHER","userName":"chen","activeState":"ACT","cardType":"VCAD","drainChnTpCd":"JINFU"}}",
LAST);
注意:body里面的json,在loadrunner中需要加转意字符。
注意:RecContentType, 一定要是“application/json”。
以上是关于关于loadrunner录制发送http请求的几种脚本格式的主要内容,如果未能解决你的问题,请参考以下文章