51Testing软件测试论坛
标题:
对于这类接口怎么测试
[打印本页]
作者:
jonish
时间:
2014-5-9 16:15
标题:
对于这类接口怎么测试
http协议 post方法 接口,怎么测试,,lR怎么写脚本,能给个例子不?
[attach]90216[/attach]
作者:
goopy
时间:
2014-5-12 16:15
你这是什么工具
作者:
murphy_Ma
时间:
2014-5-13 10:39
web_reg_save_param ("test_result", "LB=\"test_result\":\"", "RB=\",", "Search=Body", LAST);
web_custom_request (reqName,
"URL=http://192.168.16.109:8088/v1/auth?method=get",
"Method=POST",
LAST);
eg:web_reg_save_param ("test_result", "LB=\"test_result\":\"", "RB=\",", "Search=Body", LAST);
中的test_result为这个post请求的返回值,如果有返回值并需要比较就截取;如果没有可以忽略
HP Loadrunner/Documentations/Fuction Refrence 里面有相关函数的用法
作者:
sun.sun
时间:
2014-6-3 23:09
lr_start_transaction("mylogin");
web_reg_save_param("mlogin",
"LB=resultcode",
"RB=resultinfo",
"SaveOffset=4",
"SaveLen=3",
"NotFound=ERROR",
"Search=All",
LAST);
web_custom_request("Mylogin",
"URL=http://192.168.1.123:8086/user/userlogin",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={\"userName\" : \"7571@qq.com\","
"\"passWord\" : \"111111\","
"\"width\" : \"50\","
"\"height\" : \"50\"}",
LAST);
if(strcmp(lr_eval_string("{mlogin}"),"200")==0)
{
lr_end_transaction("mylogin",LR_PASS);
return 0;
}
else
{
lr_end_transaction("mylogin", LR_FAIL);
return -1;
}
return 0;
作者:
sun.sun
时间:
2014-6-3 23:11
回复
1#
jonish
lr_start_transaction("mylogin");
web_reg_save_param("mlogin",
"LB=resultcode",
"RB=resultinfo",
"SaveOffset=4",
"SaveLen=3",
"NotFound=ERROR",
"Search=All",
LAST);
web_custom_request("Mylogin",
"URL=http://192.168.1.123:8086/user/userlogin",
"Method=POST",
"TargetFrame=",
"Resource=0",
"Referer=",
"Mode=HTTP",
"EncType=application/json",
"Body={\"userName\" : \"7571@qq.com\","
"\"passWord\" : \"111111\","
"\"width\" : \"50\","
"\"height\" : \"50\"}",
LAST);
if(strcmp(lr_eval_string("{mlogin}"),"200")==0)
{
lr_end_transaction("mylogin",LR_PASS);
return 0;
}
else
{
lr_end_transaction("mylogin", LR_FAIL);
return -1;
}
return 0;
欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/)
Powered by Discuz! X3.2