【性能測試】腳本開發,最普通的http協議腳本

放上來作個備份:html

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;

}
相關文章
相關標籤/搜索