|
基于C++的开发的接口,使用loadrunner调用dll中的函数接口,对接口做性能测试,请问这个怎样设置场景呢?
比如登录接口的测试,怎么做呢?
Action中的代码如下。
Action()
{
int a =0;
int b =0;
int c =0;
char ID[50] = "test";
char Pwd[50] = "bWOoZQCy";
char VersionName[50] = "version04";
lr_start_transaction("s01_init");
RJZC_Init(); //初始化
lr_end_transaction("s01_init", LR_AUTO);
lr_think_time(3);
lr_start_transaction("s01_sysdelrec");
a = RJZC_SysDelRecs(1); //强制删除订单
lr_end_transaction("s01_sysdelrec", LR_AUTO);
lr_think_time(3);
lr_start_transaction("s01_login");
b = RJZC_Login(ID,Pwd,1,VersionName);
lr_end_transaction("s01_login", LR_AUTO);
lr_think_time(5);
lr_start_transaction("s01_logout");
c = RJZC_Logout(ID,1);
lr_end_transaction("s01_logout", LR_AUTO);
lr_output_message("------- %d -------", a);
lr_output_message("------- %d -------", b);
lr_output_message("------- %d -------", c);
return 0;
}
|
|