loadrunner 检查点
vuser_init(){
int code = 0;
char str;
char *port;
lrs_startup(257);
lrs_create_socket("socket0", "TCP", "RemoteHost=10.138.15.67:60000",LrsLastArg);
port = lrs_get_socket_attrib("socket0",LOCAL_PORT );
// lr_think_time(1);
lrs_send("socket0", "buf0", LrsLastArg);
//lrs_set_receive_option(EndMarker,RecordingSize);
lrs_receive("socket0", "buf1", LrsLastArg);
//lrs_save_param("socket0",NULL, "param", 1, 3);
lr_output_message("===========local socket port is : %s",port);
code = lrs_save_param_ex("socket0", "received", NULL, 0, 3,NULL, "param");
lr_output_message("socket return code %d",code);
//lr_think_time(1);
//lr_output_message(lr_eval_string("<param>"));
//lr_output_message(
//lr_output_message((char *)(strstr(lr_eval_string("<param>"),"err")));
//lr_think_time(1);
strcpy(str,lr_eval_string("<param>"));
//lr_output_message(lr_eval_string("<param>"));
if(strcmp(str,"err") == 0)
{
lr_output_message("in err handle!");
return -1;
//vuser_end();
} 什么时候需要插入检查点呀? 使用socket协议可以做检查点吗? 建议使用http方式做,如果必须使用socket协议,可以做发送并接受socket信息之后,增加一个数据库查询语句并打印 ,看数据库的情况来判断是否满足实际业务
页:
[1]