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

Parameterized questions in LR (one day the interview was difficult)

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

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

The interviewer asked a question.

Have a user and need to be parameterized

User

one

two

three

Now there are 3 users, how to set the parameterized value to 1Jing 2jin2?

At that time, I was suddenly confused. After coming down, I looked up all kinds of materials.

There is only one way to answer: Random + Each occurrence

Parametric detailed explanation (transferred from Xiaoqiang teacher)

I. Preface

Hope that do not understand the Loadrunner parameterization of the parameter update rules, after reading it can be completely liberated.

Second, the premise hypothesis

Assume that it exists:

Data: a, B, C

Virtual users: Vuser1, Vuser2, Vuser3

The parameters appear three times in the script and the script iterates three times

How to fetch the next row of data?

Sequential: order in which all virtual users read data tables sequentially

Random: random, all virtual users read data tables in random form

Unique: unique, all virtual users take one value at a time (do not repeat)

When will the data update be completed by accessing the data table?

Each iteration: after each iteration

Each occurrence: parameters for each occurrence

Once: change only once

III. Combination of examples

Example:

Sequence

Sequential + Each iteration

In the first iteration, whenever the parameters appear, Vuser1, Vuser2, Vuser3 take A

In the second iteration, whenever the parameters appear, Vuser1, Vuser2, Vuser3 take B

In the third iteration, whenever the parameters appear, Vuser1, Vuser2, Vuser3 take C

Sequential + Each occurrence

The parameters of the Nth iteration are Vuser1, Vuser2, Vuser3 and A for the first time.

The parameters of the Nth iteration are Vuser1, Vuser2, Vuser3 and B for the second time.

The parameters of the Nth iteration are Vuser1, Vuser2, Vuser3 and C for the third time.

Sequential + Once

In the Nth iteration, whenever the parameters appear, Vuser1 take A Vuser2, take B Vuser3, take C.

Random

Random + Each iteration

No matter how many times this parameter is encountered in the Nth iteration, Vuser1 will only take A, B, or C, and this iteration will not be updated.

No matter how many times this parameter is encountered in the Nth iteration, Vuser2 will only take A, B, or C, and this iteration will not be updated.

No matter how many times this parameter is encountered in the Nth iteration, Vuser3 will only take A, B, or C, and this iteration will not be updated.

After 1 iteration, each Vuser extracts data at random.

Random + Each occurrence

The parameters Vuser1, Vuser2 and Vuser3 are randomly selected from A, B and C for the first time in the Nth iteration.

When the parameters Vuser1, Vuser2 and Vuser3 are encountered in the Nth iteration for the second time, one of them is randomly selected from A, B and C.

The parameters Vuser1, Vuser2 and Vuser3 are randomly selected from A, B and C for the third time in the Nth iteration.

Each Vuser continues to re-extract data every time a parameter is encountered during the first iteration of Null.

Random + Once

No matter how many times the parameter is encountered in the Nth iteration, Vuser1 only takes A, or B, or C

No matter how many times the parameter is encountered in the Nth iteration, Vuser2 only takes A, or B, or C

No matter how many times the parameter is encountered in the Nth iteration, Vuser3 only takes A, or B, or C

Each Vuser does not re-extract data after 1 iteration of Null.

Only

Note: when using this Unique type, you must note that there are enough numbers in the data table.

For example, if 20 virtual users are set in Controller for 5 cycles, then the virtual user numbered 1 takes the first five numbers, and the virtual user numbered 2 takes the number from 6 to 10, and so on, so that there must be at least 100 pieces of data in the data table, otherwise an error will be returned during the running of Controller.

So the following example adds data D, E, F, G, H, I to the data table.

Unique + Each iteration

In the first iteration, no matter how many times the parameter appears, Vuser1 takes A Vuser2, D Vuser3 takes G

In the second iteration, no matter how many times the parameters appear, Vuser1 takes B Vuser2, E Vuser3 takes H

In the third iteration, no matter how many times the parameters appear, Vuser1 takes C Vuser2, F Vuser3 takes I.

Unique + Each occurrence

The parameter Vuser1 appears for the first time in the first iteration, taking A Vuser2, D Vuser3, G

The parameter Vuser1 appears in the first iteration and the second time, take B Vuser2, take E Vuser3, take H

The parameter Vuser1 appears in the first iteration and the third time, take C Vuser2, take F Vuser3, take I.

Unique + Once

No matter how many iterations are carried out, no matter when the parameter appears, Vuser1 takes A Vuser2, B Vuser3 takes C

Data D, E, F, G, H, I are not taken.

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