loadrunner对于getpost接口压测
Posted wx921308494
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了loadrunner对于getpost接口压测相关的知识,希望对你有一定的参考价值。
1.选择WebServer协议
2.点击Insert-New Step
注意:
web_custom_request:适用于Get和POST请求通用
web_submit_data:只能用于POST请求
web_submit_form:只能用于Get请求
3.Vuser-Run Time Settings
log 中间三项全部选上
Action()
{
int code;
lr_rendezvous("jihe");
lr_start_transaction("start");
web_submit_data("web_submit_data",
"Action=http://192.168.1.***/App/Login/login",
"Method=POST",
"TargetFrame=",
"Referer=",
ITEMDATA,
"name=sign__value","value=m1Iw0VqQVflfUlbq4mgCq5R02DyNQeG0y12kiIZxZJJJAp38A5f6GkIG4VYaNNLBaNqDHRhlbCCjkVJIqyVFfFwCq5dePRTzbENSTX5DoCneMqCw+gPy/LnNCeGsw0tZvpGc/w2Priwnb5msGujPXa7+ikE3qIaf3Qe7+zojX+o=",ENDITEM,
LAST);
code=web_get_int_property(HTTP_INFO_RETURN_CODE);
if(code==200)
{
lr_output_message("成功!");
}
else
{
lr_output_message("失败!");
}
lr_end_transaction("start", LR_AUTO);
return 0;
}
![技术图片](https://upload-images.jianshu.io/upload_images/16945005-5437d82d5d419ee2.png?imageMogr2/auto-orient/strip|imageView2/2/w/1200)
以上是关于loadrunner对于getpost接口压测的主要内容,如果未能解决你的问题,请参考以下文章