码迷,mamicode.com
首页 > 其他好文 > 详细

网关LR测试脚本

时间:2017-08-26 11:33:20      阅读:218      评论:0      收藏:0      [点我收藏+]

标签:ret   nbsp   headers   int   mui   rest   led   resource   else   

一、网关引擎测试脚本

http://10.110.20.197/api-gateway-engine/API/LsqGrp1/V0001/LsqApi1A?param11=req11&param12=req12&param21=req21&param22=req22

#include "web_api.h"
Action()
{
int HttpRetCode;
web_add_cookie("MUID=1758581795A969EC26F352D291A96FCA; DOMAIN=www.bing.com");

web_add_header("Content-Type","application/json");
web_add_header("Accept","application/json");
web_add_header("x-ca-front-signature","oGvqUMw7fZISooGjY8z3qbVeb49SdDyDQCBAKS3t4xc=");
web_add_header("x-ca-front-devclientkey","f9993621997249ae8c930067011d0d8a");
web_add_header("x-ca-front-sign-headers","x-ca-front-timestamp,x-ca-front-nonce,x-ca-request-mode");
web_add_header("x-ca-front-timestamp","1503383699505");
web_add_header("x-ca-front-nonce","223344");
web_add_header("x-ca-request-mode","debug");
web_add_header("x-auth-token","445db7ec304a47778632694d7c8983a7");

web_url("favicon.ico",
"URL=http://10.110.20.197/api-gateway-engine/API/LsqGrp1/V0001/LsqApi1A?param11=req11&param12=req12&param21=req21&param22=req22",
"Resource=1",
"RecContentType=image/x-icon",
"Referer=",
"Snapshot=t1.inf",
LAST);

//{"result11":"res11-req11","result12":"res12-req12","result21":"res21-req21","result22":"res21-req22"}

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message("The Vuser exec-succeed!");
else
lr_log_message("The Vuser exec-failed!");

return 0;

}

二、SvcApp测试脚本

http://10.110.20.197/DemoWeb/rest/SpringJson/GetJson2.do?param11=req11&param12=req12&param21=req21&param22=req22

#include "web_api.h"
Action()
{
int HttpRetCode;
web_add_cookie("MUID=1758581795A969EC26F352D291A96FCA; DOMAIN=www.bing.com");

web_add_header("Content-Type","application/json");
web_add_header("Accept","application/json");
web_add_header("x-ca-front-signature","oGvqUMw7fZISooGjY8z3qbVeb49SdDyDQCBAKS3t4xc=");
web_add_header("x-ca-front-devclientkey","f9993621997249ae8c930067011d0d8a");
web_add_header("x-ca-front-sign-headers","x-ca-front-timestamp,x-ca-front-nonce,x-ca-request-mode");
web_add_header("x-ca-front-timestamp","1503383699505");
web_add_header("x-ca-front-nonce","223344");
web_add_header("x-ca-request-mode","debug");
web_add_header("x-auth-token","445db7ec304a47778632694d7c8983a7");

web_url("favicon.ico", 
"URL=http://10.110.20.197/DemoWeb/rest/SpringJson/GetJson2.do?param11=req11&param12=req12&param21=req21&param22=req22", 
"Resource=1", 
"RecContentType=image/x-icon", 
"Referer=", 
"Snapshot=t1.inf", 
LAST);

//{"result11":"res11-req11","result12":"res12-req12","result21":"res21-req21","result22":"res21-req22"}

HttpRetCode = web_get_int_property(HTTP_INFO_RETURN_CODE);
if (HttpRetCode == 200)
lr_log_message("The Vuser exec-succeed!");
else
lr_log_message("The Vuser exec-failed!");

return 0;

}

网关LR测试脚本

标签:ret   nbsp   headers   int   mui   rest   led   resource   else   

原文地址:http://www.cnblogs.com/lexiaofei/p/7434713.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!