Detailed description of LoadRunner parameterization

Source: Internet
Author: User

Distance from last useLoadRunnerIt has been more than a year. I used it in the project when I first started the test, but I couldn't use it in later projects. I put my focus on something other than tools. I think performance testing is not just about using tools, recently, I want to have a good tool to help myself perform better performance testing. This is a cognitive process!

Open in next installationLoadRunnerI found that my thoughts are still in progress, but I am very unfamiliar with them. I cannot find a specific location for many settings. ParameterizationParameterization is the most common technique in performance testing! It should be noted that not onlyLoadRunnerParameters can be set.JmeterSimilar settings are also available.

We know that the performance testing tool simulates multiple users to verify the system performance (this statement is not completely correct ), some systems allow multiple identical users to perform identical operations on identical data at the same time, while others do not. For example, a mailbox generally allows the same account to log on in multiple places. And ourQqThe account is not allowed. For example, when you register a system, the user name cannot be repeated. But the password is OK. Therefore, parameterization techniques are required in so many cases.

We useLoadurnnerRecord one139Email login. Below is a small screenshotCode

 

 ...... Web_submit_form (  "  Login. ashx  "  ,  " Snapshot = t3.inf  "  , Itemdata,  "  Name = Username  " , "  Value =Chongshi  "  , Enditem,  "  Name = Password  " , "  Value =123456 "  , Enditem,  "  Name = verifycode  " , "  Value =  "  , Enditem,  "  Name = auto  " , "  Value = <off>  "  , Enditem, extrares ,...... 

The following describes how to useLoadRunnerParameterization of user name and password.The highlighted content is the login user name and password.

 

Parameterization method

Select the content to be parameterized.

Method 1: Right-click---【Replace with a new parameter]

Method 2: Menu 【Insert]----【New Parameter...]

Parameter properties (Parameter Properties dialog box)----The parameter settings are completed in this dialog box.

 

Parameterization:

In fact, there are many parameterization methods. Here we will briefly describe several common methods. In fact, the method is slightly different, but the result is to add the data.

1. edit data

ClickCreate TableThe table appears. In the table, clickEdit with notepadAnd a notepad will be opened. We can add data to the notepad.

 

2. AddTxtData Files

ClickFile"Browse .."Button to find the localTxtTo add the data file.

It should be noted that the data in the file should not be written in disorder. each row of data will be read incorrectly.

 

3. Add data to the database

In many cases, I have not added 10 or 20 records of data, nor one hundred. If I add data in the above two ways, I think it will be very tangled. So we can import data through the database. Do you have doubts about how to get the database data? The database data generation is very simple. You can write a simple piece of code to generate it, or you can use the database data generation tool to complete it.

ClickDate wizardOpen the Database Connection wizard. 

Here we will first tell you this method, and then introduce the specific operation.Pai_^

 

4. Other Types

If we want to parameterize not a file, such as a specific date and time, we canParameter type Select from the list

The date and time format can be set here, And the loop iteration method can be used,FileOther types are not used. I am not very familiar with other types of usage.

 

Association between parameterization

We have already parameterized the user name or the password, so that the script can run normally. Because the user name and password do not have a one-to-one relationship, if the user name and password used for each script run are not matched, the problem will certainly occur.

Assume that the user name has been parameterized and the parameter name is 【Username]. Set the password parameterization to associate with the user name.

Click"Properites...The Edit username parameterization window is displayed.FileIn the list box, the file that saved the username information just now"Username. dat".

Click"Add Column...",Add a new column of information for password placement.

 

Click"Edit with notepad"Edit the parameterized data file again to create a one-to-one correspondence between the user name and password.

After that, we have successfully parameterized the user name and password, and formed a ing between the user name and password.

 

Data allocation and update Methods

After the script is set to parameterized, the parameterized values obtained for each script run are different. So what is the case for this value? There are many ways

Select next row[Select the next line ]:

Order (Sequential): According to the parameterized data order, one by one.

Random (Random): Parameterized data, which is randomly extracted from each parameter.

Unique (Unique): Assign a unique data record to each virtual user

 

Update value on[New value ]:

Each iteration(Each iteration): Get a new value for each iteration. If50Each user obtains the first data, which is called an iteration.50Users get the second data, and so on.

Each time(Each occurrence): Get a new value for each parameter. It is emphasized that the values of the two parameters cannot be the same.

Retrieve only once(Once) : One piece of data in parameterization can only be extracted once. (If the script is still running after the data rounds, an error is reported)

 

The preceding two options have three conditions. If you combine them, nine value methods are generated.

Select next row

[Select the next line]

Update value on

[New value]

Replay result

Result]

sequence ( sequential )

(each iteration)

result: 15 writing data to a data table

Function Description: obtains the value of a row at each iteration starting from the first row. When all values are obtained, they are obtained from the first line.

for example: if the parameterized file contains 15 data entries, while iteration is set to 16 times, in the execution result, there are two data entries in the first line of the parameterized file

sequence ( sequential )

(each occurrence)

result: 15 writing data to a data table

Function Description: obtains the value of a row at each iteration starting from the first row. When all values are obtained, they are obtained from the first line.

for example: if the parameterized file contains 15 data entries, while iteration is set to 16 times, in the execution result, there are two data entries in the first line of the parameterized file

Order (Sequential)

Retrieve only once(Once)

Result: data is written to the table.15Exactly the same data.

Function Description: the first row of data in the parameterized file is used for each iteration.

Random (Random)

Each iteration(Each iteration)

Result: data is written to the table.15Data entries, but duplicate data may appear.

Function Description: randomly selects a row of data from the parameterized file to assign values each time.

Random (Random)

Each time(Each occurrence)

Result: data is written to the table.15Data entries, but duplicate data may appear.

Function Description: randomly selects a row of data from the parameterized file to assign values each time.

Random (Random)

Retrieve only once(Once)

Result: data is written to the table.15Same data entries

Function Description: a row of data is randomly retrieved from the parameterized file during the first iteration. Data of the first iteration is used for each subsequent iteration.

unique ( unique )

(each iteration)

Automatic Block Size allocation

result: 15 writing data into a data table

Function Description: The first iteration obtains the first data in the parameterized file, the second iteration retrieves the second data, and so on.

Note: If you set the number of iterations to 16 times. Result: The 16 An exception is thrown during the next iteration. The exception log can be found in LoadRunner playback log ( replaylog .

Unique (Unique)

Each time(Each occurrence)

Step Size:1

result: 15 writing data into a data table

Function Description: The first iteration obtains the first data in the parameterized file, the second iteration retrieves the second data, and so on.

Note: If you set the number of iterations to 16 times, and only 15 there are obviously insufficient data entries. In this case, you can set " when out of values " attribute to determine the processing method when data is insufficient

abort vuser : virtual user interruption

countinue in a Cylic manage: cyclically obtain the values in the parameterized file, that is, when the values in the parameterized file are obtained, the values start from the first line of the parameterized file.

countinue with last value : continue to use the last data record

Unique (Unique)

Retrieve only once(Once)

Result: data is written to the table.15Same data entries

Function Description: assign values to the first data in the parameter file every time.

PS: The method for calling the database to implement parameterization is described in the next article. This is a problem with an egg headache.ArticleOne day.

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.