LR脚本字符串处理
上一篇 / 下一篇 2012-06-28 17:27:21 / 个人分类:性能测试
web_reg_save_param("ss", //参数名
"LB/IC=3424", //左边界 ‘ /IC不区分大小写
"RB=23423", //右边界
"Ord=1", //查找顺序(第几个)
"SaveOffset=4",//偏移4位
"SaveLen=4", //数据长度。值为4表示数据长度为4
"NotFound=WARNING",
"Search=All",//查找范围
"RelFrameId=1",//相关的Frame的ID。便于缩小日志查找范围。从replaylog中可找到
LAST);
【"LB/BIN=\\x3F\\xDD",需要关联的内容是非ASCALL码,如二进制】
// [WCSPARAM party_id 10 ] Parameter {party_id} created by Correlation Studio
web_reg_save_param("policy_code",
"LB=Policy No.: ",
"RB=<",
"Ord=1",
"RelFrameId=1",
"Search=Body",
LAST);
// [WCSPARAM customer_id_ph_again 10HO 0300008] Parameter {customer_id_ph_again} created by Correlation Studio
web_reg_save_param("apply_code",
"LB=Proposal No.: ",
"RB= Policy No",
"Ord=1",
"RelFrameId=1",
"Search=Body",
LAST);
// [WCSPARAM customer_id_ph_again 10HO0300008] Parameter {customer_id_ph_again} created by Correlation Studio
web_reg_save_param("apply1_code",
"LB=Proposal No.: ",
"RB= Policy No",
"Ord=1",
"SaveLen=3",
"Search=Body",
"RelFrameId=1",
LAST);
// [WCSPARAM customer_id_ph_again 10 HO0300008] Parameter {customer_id_ph_again} created by Correlation Studio
web_reg_save_param("apply2_code",
"LB=Proposal No.: ",
"RB= Policy No",
"Ord=1",
"SaveOffset=3",
"SaveLen=5",
"Search=Body",
"RelFrameId=1",
LAST);
// [WCSPARAM customer_id_ph_again 10 HO 0300008] Parameter {customer_id_ph_again} created by Correlation Studio
web_reg_save_param("apply3_code",
"LB=Proposal No.: ",
"RB= Policy No",
"Ord=1",
"SaveOffset=8",
"SaveLen=2",
"Search=Body",
"RelFrameId=1",
LAST);
lr_start_transaction("LS32_NBU0170_All_05_SubmitReception");
web_submit_data("dataEntrySubmit.do",
"Action=http://172.16.7.84:23000/ls/pa/dataEntrySubmit.do",
"Method=POST",
"TargetFrame=",
"RecContentType=text/html",
"Referer=http://172.16.7.84:23000/ls/pa/dataEntryDisp.do",
"Snapshot=t25.inf",
"Mode=HTML",
ITEMDATA,
"Name=syskey_page_token", "Value={WCSParam_Text1}", ENDITEM,
"Name=applyCodePrefix", "Value=HO", ENDITEM,
"Name=agentCode", "Value=001", ENDITEM,
"Name=agentCode_helpB", "Value=..", ENDITEM,
"Name=serviceAgent", "Value=9000", ENDITEM,
"Name=appointmentDate", "Value=05/06/2008", ENDITEM,
"Name=agentStatus", "Value=0", ENDITEM,
"Name=agentSubStatus", "Value=null", ENDITEM,
"Name=internalId", "Value=0170", ENDITEM,
"Name=internalId_helpB", "Value=..", ENDITEM,
"Name=productName", "Value=FLEXILIFE 20", ENDITEM,
"Name=productId", "Value=42", ENDITEM,
"Name=insType", "Value=1", ENDITEM,
"Name=endDate", "Value=", ENDITEM,
"Name=prdBereavementInd", "Value=N", ENDITEM,
"Name=prdAlly", "Value=0", ENDITEM,
"Name=isApilp", "Value=N", ENDITEM,
"Name=branchIdForDefaultMoney", "Value=101", ENDITEM,
"Name=submissionDate", "Value=01/06/2008", ENDITEM,
"Name=applyDate", "Value=01/06/2008", ENDITEM,
"Name=moneyId", "Value=8", ENDITEM,
"Name=initialPrem", "Value=400000", ENDITEM,
"Name=initialPremCurrency", "Value=8", ENDITEM,
"Name=spServiceBranch", "Value=01", ENDITEM,
"Name=origin", "Value=", ENDITEM,
"Name=autoProposalNo", "Value=Y", ENDITEM,
"Name=organId", "Value=101", ENDITEM,
"Name=tabType", "Value=", ENDITEM,
LAST);
lr_end_transaction("LS32_NBU0170_All_05_SubmitReception", LR_AUTO);
lr_think_time(5);
web_url("mainMenu.do_2",
"URL=http://172.16.7.84:23000/ls/mainMenu.do",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=",
"Snapshot=t26.inf",
"Mode=HTML",
LAST);
web_url("loadKPI.do_3",
"URL=http://172.16.7.84:23000/ls/dashboard/loadKPI.do",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.7.84:23000/ls/mainMenu.do",
"Snapshot=t27.inf",
"Mode=HTML",
LAST);
web_url("msglist.jsp_3",
"URL=http://172.16.7.84:23000/ls/ls/dashboard/msglist.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.7.84:23000/ls/mainMenu.do",
"Snapshot=t28.inf",
"Mode=HTML",
LAST);
web_url("kpi_product.jsp_3",
"URL=http://172.16.7.84:23000/ls/ls/dashboard/kpi_product.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.7.84:23000/ls/mainMenu.do",
"Snapshot=t29.inf",
"Mode=HTML",
LAST);
web_url("tasklist.jsp_3",
"URL=http://172.16.7.84:23000/ls/ls/dashboard/tasklist.jsp",
"TargetFrame=",
"Resource=0",
"RecContentType=text/html",
"Referer=http://172.16.7.84:23000/ls/mainMenu.do",
"Snapshot=t30.inf",
"Mode=HTML",
LAST);
web_url("loadXML4MsgList.do_3",
"URL=http://172.16.7.84:23000/ls/dashboard/loadXML4MsgList.do",
"TargetFrame=",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://172.16.7.84:23000/ls/ls/dashboard/msglist.jsp",
"Snapshot=t31.inf",
"Mode=HTML",
LAST);
web_url("loadXML4TaskList.do_3",
"URL=http://172.16.7.84:23000/ls/dashboard/loadXML4TaskList.do",
"TargetFrame=",
"Resource=0",
"RecContentType=text/xml",
"Referer=http://172.16.7.84:23000/ls/ls/dashboard/tasklist.jsp",
"Snapshot=t32.inf",
"Mode=HTML",
LAST);
web_add_cookie("current_module_id=400070; DOMAIN=172.16.7.84");
char * policy_code=lr_eval_string("{policy_code}");
char policy_text[11];
char tmp_char;
char * apply1_code=lr_eval_string("{apply1_code}");
char * apply2_code=lr_eval_string("{apply2_code}");
char * apply3_code=lr_eval_string("{apply3_code}");
char apply_text[11];
// HO /03000/08 HO 0300008
char fullpath[1024];
strcpy(fullpath,"HO ");
strcat(fullpath,"/");
strcat(fullpath,apply2_code);
strcat(fullpath,"/");
strcat(fullpath,apply3_code);
lr_output_message("Full path of file is %s", fullpath);
lr_save_string( fullpath,
"apply_text" );
lr_output_message("Full path of file is %s", apply_text);
//generate policy_text
strcpy( policy_text,
policy_code );
//0025338918
strcat( policy_text,
"-" );
//0025338918-
tmp_char=policy_text[10];
policy_text[10]=policy_text[9];
policy_text[9]=tmp_char;
lr_save_string( policy_text,
"policy_text" );
TAG:
标题搜索
日历
|
|||||||||
日 | 一 | 二 | 三 | 四 | 五 | 六 | |||
1 | 2 | 3 | 4 | ||||||
5 | 6 | 7 | 8 | 9 | 10 | 11 | |||
12 | 13 | 14 | 15 | 16 | 17 | 18 | |||
19 | 20 | 21 | 22 | 23 | 24 | 25 | |||
26 | 27 | 28 | 29 | 30 | 31 |
我的存档
数据统计
- 访问量: 27098
- 日志数: 26
- 建立时间: 2011-05-07
- 更新时间: 2012-07-20