Control the number of characters following ABC:
Control character Length:
Summarize:
Practical application:
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;}
Action () {char cbuff[] = "ABC Emma woodhouse ABC Elizabeth Bennet ABC William price";//lr_save_string ("/iwflow/findjspi D.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 ("Haha test={test}")); return 0;}
The use of lr_save_searched_string function in LoadRunner