The IF (status = = Lr_fail) notation of the LR checkpoint

Source: Internet
Author: User
Tags time in milliseconds

C Language Example: Login failure returns a message

int status = Web_url ("Login",

"Url=https://secure.computing.com//login.asp?user={username}&session={ssid}",

"Reccontenttype=text/html", last);

if (status = = Lr_fail)

{

Lr_error_message ("Error:%s", "unable to login to secure Computing");

return-1;

}

Lr_error_message usage, this function I only know can be in: such as Judge Web_url request failed to return a state lr_fail,
Then output an error log, as for it and lr_output_message difference, I think in the Output window, this input information will be highlighted in red. haha

Lr_error_message ("Note:%s", "wrong, this should be used with caution," said Cloud God, if you write a script in order to facilitate the use of the function to debug the script and forget to delete, then in the scene execution will be recorded in the error number ");

LR Tools------General Options

Paramerterization options: setting of parameterized boundaries

Replay: script Playback settings:

Debug:

Animated run () The wait time in milliseconds for a function in MSEC:LR with another function to slow down the script

Action ()

{

int i,j,k;

Char *message;

j = k = 1000;

message = "Information";

Lr_message ("**************** output area starts *****************");

Lr_message ("Lr_message%s: decimal =%d, octal =%o, Hex =0x%x", message,j,j,j);

Lr_log_message ("Lr_log_message%s: decimal =%d, octal =%o, Hex =0x%x", message,j,j,j);

Lr_error_message ("Lr_error_message%s: decimal =%d, octal =%o, Hex =0x%x", message,j,j,j);

Lr_output_message ("Lr_output_message%s: decimal =%d, octal =%o, Hex =0x%x", message,j,j,j);

Lr_message ("**************** output area end *****************");

for (i=1;i<6;i++)

{

K + = 1000;

Lr_think_time (5);

Lr_vuser_status_message ("%d times:%s, decimal =%d, octal =%o, Hex =0x%x", i,message,k,k,k);

}

return 0;

}


Example Description:
1. The function parameter format of message series is identical to the printf format in C language.
2, the format of the input glyph "%", presumably everyone is also more familiar. Where%d is decimal,%o is octal,%x is hexadecimal,%s is character, and%g,%u,%c, and so on, check it out for yourself.
3, after playing back this script, go to the script root to see Mdrv.log, all the output can be found here.
4. Lr_error_message The red font is displayed in the replay log, and the line number of the statement is displayed, and if the script runs in Controllor, an error message is generated.
5. Lr_vuser_status_message will be displayed in the Status column of the Controllor vuser list, Controllor refreshed every 5 seconds.
6, of course, also supports the use of escape characters, the list is as follows:
\a Ringtones (warning)
\b Backspace Key
\f Page Change
\ nthe line break
\ r Enter
\ t Horizontal tab
\v Vertical Tab
\ ' Single quote mark
\ "Double quotation mark
\ \ counter Slash
\? Text question mark
\ooo ASCII character-eight binary
The supported conversion characters are:
%a ASCII Representation
%BX Big Endian (network order) hex
%bo big-endian (network order) octal
? Big-endian (network order) decimal
%LX Small End Hex
%lo Small terminal octal
%ld Small-End decimal

==============================================================

LoadRunner in Lr_output_message and Lr_log_message

    LoadRunner in Lr_output_message and Lr_log_message
    (1) In Vgen, we must write output function output information, we want to understand the information with the function output, mainly have so several functions output information: Lr_output_message,lr_error_message,lr_log_message. See Help-->function reference for these functions.
    Second, we want to set in runtime settings, tick always send messages, the specific practice is: Runtime settings--->log-->always send messages, So we can write log, in the folder where our script is located, there are two files are very important, mdrv.log.txt and output.txt files, Lr_log_message will only send information to Mdrv.log file, and Lr_output_ The message will be written in the above two files.
    (2) in the controller, many friends will want to know many iterations, the parameters are imported correctly, we still look at the log, we at the end of execution, look at the log folder of the results directory, if the load generator is running, then the TMP directory. However, also want to remind friends, in controller we also have to set runtime settings, and each user group runtime settings, set the method is: in the controller's Design tab, The lower right corner has the runtime Settings button, and we click it to set the same method as in the Vgen.

    The IF (status = = Lr_fail) notation of the LR checkpoint

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.