Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

LoadRunner parameter settin

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Hi,baby~i am back! In the last blog post, I probably wrote about the recording of the login script and did not give the source code. But in fact, as long as you carefully look at the order, each part of the splicing, is already a complete part of the code. * * Today, let's take a look at the parameter settings. * * in any language, there must be parameters. What is the meaning of the existence of parameters? In my understanding, it is like putting part of the data into a box, giving the box a name, and then making it easy for us to find it. Have you all seen traditional Chinese medicine grab important medicine cabinets? Every medicine cabinet has its own name. If you don't have a name? Each data is stored in a box? Which box is it in? I don't know! Where is it? So, we need a name. So why do you need a box? Suppose all the data are piled together. I want an apple. Where is the apple? Ohh! There is one here, but there is no one! We are not Cinderella, we do not need to find Doudou in the ashes, so it is very convenient to put the same name in a box. So what is the role of parameters in our performance testing? 1. Save data (associations, checkpoints, etc.) 2. Try to simulate the real environment. Let's start with the second point. Use parameters to simulate the real environment as much as possible. Since we are going to start performance testing, we generally need to test that multiple users / requests are concurrent at the same time, or multiple users / requests continue to initiate requests over a period of time (it can be understood that the former is multi-lane and all vehicles are moving side by side at the same time. The latter is a single lane, and all vehicles need to queue up and move forward in order. Based on this, there are many variants. Suppose that if the login script is set up, if it is always in the form of a concurrent user, because the user name / password is always the same, the cache may be read directly, which will be in error with the actual corresponding time. In addition, in the actual situation, it is impossible for a user to log in concurrently or continuously, so it is necessary to set multiple user names / passwords to simulate the real environment as much as possible and reduce the error. But in LoadRunner, concurrency and multiple runs of scripts require a lot of data, so we can use parameters. Parameter setting: you can set parameters in 1.Vuser-Parameter list. Click Vuser-Parameter list and the following window appears. Click New, NewParam appears, write the parameter name, and fill in the parameter value at Value on the right.

The following sections mainly say that you can select some settings for the column of data (Select column), by number (select which column), by name (select the column with the name xx), file format settings (file format), Column (what separates different data), First data (which row the first data is taken from)

two。 Select data that needs to be parameterized in the script

Right-click Replace with a Parameter, and it will pop up for you to select a parameter, the new parameter selected by default, and select! [] if you click ok at this time, you still need to go back to the first step to set the parameter. In order to avoid one more step, you can directly click the Properties on the right, you can directly set the parameters, if you want to use other parameters instead. If you want to use external parameters instead, a Use Exiting Parameter selection will be displayed under the Replace with a Parameter sibling menu.

After the experiments of the above two methods, do you think that if you increase the parameters in this way, it will be a waste of time if the number of parameters is very large?

Maybe we can do this: click Edit with Notepad in the Parameter list window in the form of notepad

Edit, but note here that it is best to add a new line after the last parameter (LoadRunner a bug, for

To avoid mistakes can form a habit.

Our parameters are set successfully. however? How do you use the parameters? Maybe I want him to call it in a loop. I want it.

Always use a value. Do you want him to take a value for each iteration and a value for each call? These can be found in the Parameter list window.

Set up.

Different combinations have been arranged below, ladies and gentlemen, please move ~ Select next row: Sequential: sequential value Random: random value Unique: unique value Same line as: take the peer of a parameter Update value on: Each iteration: update each iteration Each occurrence: update Once every time Update the combination type only once: 1.Sequential a, combined with Each iteration: the next value is extracted from the data table for each fall. B, combined with Each occurrence: the next value is extracted from the data table for each occurrence of the parameter, even if it is in the same iteration. C, combined with Once: the values assigned in the first iteration are used in all subsequent iterations of each Vuse. 2.Random a, combined with Each iteration: a new random value will be extracted from the data table for each iteration. B, combined with Each occurrence: a new random value will be extracted from the data table for each occurrence of the parameter, even if it is in the same iteration. C, combined with Once: the random values assigned in the first iteration will be used in all iterations changed to Vuser. 3.Unique a, combined with Each iteration: the next unique value will be extracted from the data table for each iteration. B, combined with Each occurrence: a new unique value will be extracted from the data table for each occurrence of the parameter, even if it is in the same iteration. Unique: it means to guarantee the uniqueness of data usage. Automatic allocation can automatically allocate data blocks according to the number of iterations and the number of data pieces. If you choose to take a value for each iteration-automatically take a value, then the data block = total number of data / number of iterations, eg: there are five pieces of data, iterations 2 times, then the value is selected manually. You can set allocate [] values for each Vuser and set the number of data in the data block. If the number of calls by each user exceeds, only the desired value will be taken. Note: Each iteration can choose automatic or manual, each occurrence must be assigned manually

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report