【性能测试】脚本开发,最普通的http协议脚本

放上来做个备份:

Action()
{
    double transTime; // 事务消耗时间

    lr_start_transaction("营销_01_MSMH0011_查询拥有码列表");

    web_reg_save_param("Response","LB=","RB=",LAST);
    web_reg_save_param("ec","LB=<ec>","RB=</ec>","Notfound=warning",LAST);

    web_url("query",
         //   "URL=http://10.2.33.107:9080/mpbank/mobile/clientService.do?rf=XML&tranCode=MHYC11&certNo=440600199012310037&certType=8&srcChannel=MH",
            "URL=http://21.96.63.165:9002/mpbank/mobile/clientService.do?rf=XML&tranCode=MSMH0011&certNo={certNo}&certType=0&srcChannel=MH",            
            "Resource=1",
            "RecContentType=text/html",
            "Referer=",
            "Snapshot=t1.inf",
            "Mode=HTML",
             LAST);
    transTime = lr_get_transaction_duration("营销_01_MSMH0011_查询拥有码列表");
    if(transTime>5)
    {
        lr_error_message("transTime:%f,卡号:%s",transTime,lr_eval_string("{cert_No}"));
    }
    if(0==strcmp(lr_eval_string("{ec}"),"0"))
    {
        lr_end_transaction("营销_01_MSMH0011_查询拥有码列表", LR_PASS);
        lr_error_message("MSMH0011查询:%s",lr_eval_string("{Response}"));
    }
    else
    {
        lr_end_transaction("营销_01_MSMH0011_查询拥有码列表", LR_FAIL);
        lr_error_message("MSMH0011查询失败:%s",lr_eval_string("{Response}"));
    }

    return 0;

}

 

posted @ 2018-05-15 10:06  fy-  阅读(313)  评论(0编辑  收藏  举报