LR-并发下检查功能结果

2019-11-26  本文已影响0人  雪山非猪

这是个秒杀的接口,我需要测试:

1、并发情况下,接口返回结果是否都正确

2、并发情况下,秒杀数据正确性

ok()

{

int MyFile2; 

int LoginRes = 1; 

//设置文档的位置 

char *addr1="D://myPass1101.txt";   

web_reg_find("Text=验证码不正确", "SaveCount=para_count", LAST); //check 的函数

    web_submit_data("lottery.jsp",

        "Action=https://v2.pcauto.com.cn/activities/auto191107/action/lottery.jsp",

"Method=POST",

"RecContentType=text/html",

"Snapshot=t7.inf",

"Mode=HTML",

ITEMDATA,

"Name=uid", "Value={uid}", ENDITEM,

"Name=source", "Value=2", ENDITEM,     

LAST);

//查看文件是否存在,如果不存在,输出错误 

if((MyFile2= fopen(addr1,"a+"))==NULL) 

  lr_error_message("Can't open this file",addr1); 

  return -1; 

}

if (atoi(lr_eval_string("{para_count}"))>0)

{ //验证是否找到了页面上的要检查的字符串

lr_output_message(lr_eval_string("{para_count}"));

fprintf(MyFile2,"y%su/n",lr_eval_string("{uid}"));

}else{

lr_output_message("sorry,don't find the string!");

}

//关闭文件 

fclose(MyFile2); 

//lr_end_transaction("lottery", LR_AUTO);

return 0;

}

上一篇 下一篇

猜你喜欢

热点阅读