Splitting a string with the Strtok function
You need to get "15" (the red highlighted below) in the LoadRunner and make the correlation parameter.
Body Response content: <BODY><; pre>//ok[8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1
Use Web_reg_save_param take Out "8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1" this paragraph, and then use Strtok function to cut out a number, the fourth number is to find the value
For example:
extern char * strtok (char * string, const char * delimiters); EXPLICIT Declaration
Char separators[] = ",";
char * token;
Lr_save_string ("1,2,3,4,5,6", "str");
token = (char *) strtok (lr_eval_string ("{str}"), separators); Get the first token
if (!token) {
Lr_output_message ("No tokens found in string!");
Return (-1);
}
while (token! = NULL) {//While valid tokens is returned
Lr_output_message ("%s", token);
token = (char *) strtok (NULL, separators); Get the next token
}
Splitting a string with the Strtok function requires a "15" (the red highlighted part below) in the LoadRunner, and is made into an associative parameter. Body Response content: <BODY><; pre>//ok[8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1 use Web_reg_save_param to take out "8,7,5,15,6,5,0,4,0,3,0,3,2,0,0,0,1" this paragraph, Then use the Strtok function to cut out a number, the fourth number is the value to find for example: extern char * strtok (char * string, const char * delimiters); Explicit Declaration char separators[] = ","; char * token; Lr_save_string ("1,2,3,4,5,6", "str"), token = (char *) strtok (lr_eval_string ("{str}"), separators); Get the first token if (!token) { lr_output_message ("No tokens found in string!"); Return (-1); } while (token! = NULL) {//While valid tokens is returned Lr_output_message ("%s", token); token = (char *) strtok (NULL, separators); Get the next token }
Splitting a string with the Strtok function