Functions:-
1,
In the following example, lr_error_message sends a message to the LoadRunner output window or Application Management agent log file if the login fails. lr_abort is then invoked to abort the script.
2.
The following example uses abs to convert the integers 23 and -11 to their absolute values:
3
In the following example, the web_add_cookie function adds a cookie with the name "client_id" to the list of cookies available to the script.
web_add_cookie ("client_id=China127B; path=/; expires=Wednesday, 09–Nov–2001 23:12:40 GMT; domain=www.cnn.com");
4
The following example gets the time as a time_t structure and converts it to a tm structure, gmt, in Coordinated Universal Time.asctime then takes gmt and converts it to a string.
5
The following example converts the initial portion of the string, s, to a float.
double atof (const char *string); /* Explicit declaration */
vuser_init() {
float x;
char *s = "7.2339 by these hilts or I am a villain else";
x = atof(s); /* The %.2f formatting string limits the output to 2 decimal places */
lr_output_message("%.2f", x);
return 0;
}
vuser_init() {
float x;
char *s = "7.2339 by these hilts or I am a villain else";
x = atof(s); /* The %.2f formatting string limits the output to 2 decimal places */
lr_output_message("%.2f", x);
return 0;
}
6
The following example converts the initial portion of the string, s, to an integer.
No comments:
Post a Comment