loadrunner中lr_save_searched_string函数的使用_控制字符

loadrunner中lr_save_searched_string函数的使用_控制字符_02

loadrunner中lr_save_searched_string函数的使用_javascript_03


控制abc后面的第几个字符:

loadrunner中lr_save_searched_string函数的使用_i++_04

loadrunner中lr_save_searched_string函数的使用_i++_05

loadrunner中lr_save_searched_string函数的使用_i++_06


控制字符长度:

loadrunner中lr_save_searched_string函数的使用_i++_07

loadrunner中lr_save_searched_string函数的使用_控制字符_08

loadrunner中lr_save_searched_string函数的使用_i++_09

loadrunner中lr_save_searched_string函数的使用_i++_10

loadrunner中lr_save_searched_string函数的使用_javascript_11

总结:

loadrunner中lr_save_searched_string函数的使用_控制字符_12实际应用:

loadrunner中lr_save_searched_string函数的使用_javascript_13

Action() {   int i =0,j=0;   char *tt_url = lr_eval_string("{tt_url}");    int len= strlen(tt_url);   lr_output_message("%s",lr_eval_string("tt_url={tt_url}"));   while(tt_url[i]!='='){i++;}   while(tt_url[j]!='&'){j++;}  lr_save_searched_string(tt_url,len,0,"serialNo",1,j-i-1,"serialNo");  lr_output_message("%s",lr_eval_string("serialNo={serialNo}"));   i++;  j++;  while(tt_url[i]!='='){i++;}   while(tt_url[j]!='&'){j++;}  lr_save_searched_string(tt_url,len,0,"serviceID",1,j-i-1,"serviceID");  lr_output_message("%s",lr_eval_string("serviceID={serviceID}"));   i++;  j++;  while(tt_url[i]!='='){i++;}    while(tt_url[j]!='&'){j++;}  lr_save_searched_string(tt_url,len,0,"nodeID",1,j-i-1,"nodeID");  lr_output_message("%s",lr_eval_string("nodeID={nodeID}"));   i++;  j++;  while(tt_url[i]!='='){i++;}    while(tt_url[j]!='&'){j++;}  lr_save_searched_string(tt_url,len,0,"dealID",1,j-i-1,"dealID");  lr_output_message("%s",lr_eval_string("dealID={dealID}"));  return 0;  }

loadrunner中lr_save_searched_string函数的使用_javascript_14

Action() {          char cBuff[] = "abc Emma Woodhouse abc Elizabeth Bennet abc William Price";  // lr_save_string("/iwflow/FindJspID.jsp?serialNo=2008092200000033&serviceID=0099&nodeID=140004&dealID=2008092200000056&hisFlag=0&skillID=020401","tt_url");      lr_save_searched_string(cBuff, strlen(cBuff),2, "abc", 1,4,"test");       lr_output_message("%s",lr_eval_string("哈哈test={test}"));   return 0;  }

loadrunner中lr_save_searched_string函数的使用_javascript_15