LoadRunner Checkpoint Usage Summary

Source: Internet
Author: User

Determining if the script is successful is determined by the state returned by the server, and if the HTTP status returned by the server is Vugen, then the script is considered to be running correctly and is running. Will the error page code be returned when most systems fail? No, the general system will return a message prompt to enhance the user's feelings. For example, "website busy, please later". In fact, this time the site has been unable to correctly respond to user requests, but the Vugen script is not recognized, will mistakenly believe that the site can also be correctly accessed, resulting in analysis errors. So when a checkpoint function is needed to help verify that the request is sent out, the server's return is not the expected content, if not, then the server returns cannot provide a normal service. There are two types of checkpoints in LR: Pictures and text. Common checkpoint functions are as follows:1) the Web_find () function is used to search for the specified text string from the HTML page, 2) web_reg_find () function registers a request to search for the specified text string on the HTML page retrieved by the next action function (such as Web_url), 3) web_ The Image_check () function is used to find the specified picture from an HTML page; 4) web_global_verfication () is a registration function that registers a request to search for a text string in a Web page, with Web_reg_ Find only performs a search in the next action function, except that it executes the search for the specified text string in all subsequent action class functions; The following sections describe the use of the above functions: 1, Web_find () function parameter example:Web_find ("Web_find", "Righof=a", "Leftof=b", "What=name", last); Parameter explanation: "Web_find" defines the name of the lookup function; "Leftof" and "righof=" are used to define the left and right bounds of the lookup character; "what=" defines the lookup; For example, the above parameter means to find the left boundary is B in the page, and an Information about the name, using the function considerations: the function is to find the contents of the page, so it should be placed after the content you are looking for, and the function can only be found in scripts based on HTML mode recordingNote: When using this function, to change the settings under Vuser->run-tme settings, tick the Enable Image and the text check system by default, this option is not checked. 2, Web_reg_find () function parameter example:Web_reg_find ("Search=body", "savecount=ddd", "test=aaa", last); Parameter interpretation: Search is used to define the look-up scope, Savecount defines the lookup count variable name, which can record the number of occurrences of the lookup in the cache, which can be used to determine if the content to find is found; For example, in the example above the meaning is the body in the search for information of AAA, and the number of occurrences recorded in the variable ddd; "Code One:Web_reg_find ("Text=payment Details", last); Code ideas: 1. " Payment Details "For the text you want to check; 2. The script executes here, if the string is found on the page, the script continues to execute, and if not found, the script will error and end. 】 "code two:  Web_reg_find ("Text=payment Details", "Savecount=para_count", last); Check the function web_submit_form ("reservations.pl_2",//To check the page of the recording when the code "Snapshot=t22.inf", ITE mdata, "name= Outboundflight "," value=003;0;06/23/2007 ", Enditem," name=reserveflights.x "," value=61 ", Enditem," Name= Reserveflights.y "," value=2 ", Enditem, last);//atoi string converted to integral typeif (Atoi (lr_eval_string ("{para_count}")) >0)Verify that the string you want to check on the page is found Lr_output_message ("We find the string!"); else Lr_output_message ("Sorry,don ' t find the string!"); Code ideas: 1. " Payment Details "For the text you want to check; 2. The script executes here,regardless of whether there is a string on the page that you want to check, the script does not give an error, but executes .。 3. This code will find the number of strings you want to check and save as a parameter. Then, after the page code, check if the value of this parameter is greater than 0 to determine if the string you want to check is found. 4. The function of the atoi () function is to convert an ASCII string to an integer, the function of the lr_eval_string () function is to obtain the parameter value, replace the parameter value in the string variable with the current parameter value and return the string to "   "code three:A. Web_reg_find ("Text=payment detdils", "Fail=notfound", last), or B. Web_reg_find ("Text=payment detdils", "Fail=Found", last); Code ideas: 1. " Payment Details "For the text you want to check; 2. If the A code: the script executes here, if the check string is not found, the script will fail and stop execution. Instead, it continues. 3. B Code: The script executes here, if a check string is found, the script will fail and stop execution. On the contrary, it has been executed. " Use this function to note: The function is to find the appropriate content in the cache, so it should be placed before the search, usually written before the following six functions: Web_castom_request (); Web_image (); Web_link (); web_ Submit_data (); Web_submit_form (); Web_url ();   3, Web_image_check () function parameter description:
Web_image_check ("Web_image_check", "alt=", "src=", last);
Parameter explanation: The values of "Alt" and "SRC" are taken directly from the corresponding parameters of the image in the source code of the Web page;
Precautions: To check the Enable Image and text check in Vuser->run-tme settings when using this function, see the Considerations in Web_find ().
After testing, the function is used to find the contents of the front or back, does not affect the search results. Summary:

1, these two function function type is different, web_find is the common function, the web_reg_find is the registration function;

2, Web_find must turn on the Content Check option when using, but Web_reg_find does not have this limit;

3. Web_find can only be used in scripts based on HTML-mode recording, while Web_reg_find does not have this limitation;

4, Web_find is in the return of the page to find content, Web_reg_find is in the cache to find;

5, Web_find in the implementation efficiency is inferior to web_reg_find;

LoadRunner Checkpoint Usage Summary

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.