Analysis of LoadRunner correlation and Web_reg_save_param method

Source: Internet
Author: User
Tags list of attributes

Analysis of LoadRunner correlation and Web_reg_save_param method

First, what is the association

Association (correlation): During script playback, the client makes a request to make the correct request to the server by locating the left and right boundary values defined by the associated function (that is, association rules), finding the corresponding value in the contents of the server's response, and replacing the static value at the time of the recording with the variable. This method of dynamically acquiring server response content is called Association. It also transforms some of the dead data in the script into Dynamic Data. What needs to be correlated: when the data in the script changes every time, and the dynamic data needs to be sent to the server in the subsequent request, then the content needs to be correlated to ask the server to get the change result of the data. For example: 1. Login String. A login string with dynamic Data such as a session ID or timestamp. 2. Date/time stamp. Any string that uses a date or time stamp or other user credentials. 3. Common prefixes. A common prefix followed by a string, such as SessionID or CustomerID

Ii. Description of Web_reg_save_param function

Grammar:

int Web_reg_save_param (const char *paramname, <list of Attributes>, last);

Parameter description:

· ParamName: The parameter name of the dynamic content to be stored

· List of Attributes: Other properties, including: Notfound, LB, RB, Relframeid, Search, ORD, Saveoffset, Convert, Savelen. Property values are not case-sensitive

O Notfound: What to do when you can't find what you're looking for in the return message

O Notfound=error: An error message is sent when the content to be found is not found in the return message. This is the default value.

O Notfound=warning: When nothing is found in the return message, only a warning is given, and the script will continue to execute without interruption.

o LB (left boundary): Returns the string of the right edge of the message. The property must be, and is case sensitive.

o RB (right boundary): Returns the message to the left edge of the string. The property must be, and is case sensitive.

O Relframeid: The frame of the page you want to find relative to the URL. This property can be either all or a number, which is optional.

O Search: Returns the search scope of the information. Can be Headers,body,noresource,all (default). The nature of the genus is optional.

O ORD: A description of the occurrences of the first occurrence of the left border substring is what is needed. This property is optional and the default value is 1. If all, stores all the found content.

O Saveoffset: When a match is found, it is stored in the parameter from the beginning of the first few characters. The property cannot be a negative number, and the default value is 0.

O Savelen: When a match is found, several characters after the offset are stored in the parameter. The default value is-1, which means that the entire string, until the end, is stored in the parameter.

Third, the case analysis

Example 1:

, do not enter the query criteria, directly click on the "Query" button. The resulting data submission script is as follows:

The value is the total number of data requested, which is dynamically variable. In order to send the request correctly and get the correct result, the value needs to be associated.

Search for "Totalitem" in generation log, so you can determine the left and right boundaries of the value.

Insert the Web_reg_save_param method before the request for the script, and use {count} when submitting the data request to replace the actual value when recording. Such as:

Open the extension log and run the script to see that the correct association results.

Example 2:

The above example is using Web_reg_save_param's ord=1, just take the 1th occurrence of the left edge substring matches the required content, the following example uses Web_reg_save_param Ord=all, the match to the content to save to the array.

Based on the number of records in the message list (just for demonstration, pagination is not considered), trace generation log can see that the contents of a record contain 5 columns of content. Such as:

From there, you can determine its left and right boundaries, insert the Web_reg_save_param method before the request of the script, and use ARRSIZE/5 to replace the actual value of the recording when submitting the data request. Such as:

Where the Lr_paramarr_len method is used to take out the number length, the Lr_paramarr_idx method is used to specify the value of the array. Open the extension log and run the script to see that the correct association results.

Analysis of LoadRunner correlation and Web_reg_save_param method

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.