When optimizing the script of LoadRunner , sometimes when the request sent to the server is parameterized, the content returned by the server will also correspond to the parameterized content. For example, if the request sent has a query key=123, the server will also return a query containing 123. Content. At this time, when we use checkpoints to check the correctness of the data returned by server parameterization, we usually use the same parameters as the server.
In this way, in each iteration process, different values are taken each time to complete the checking process.
But if the script designed based on the actual scene is: within an iteration cycle, this action needs to be cycled multiple times, so the block block is introduced. Add this action to a block and set the number of cycles to 2. Run it again and get this result:
It can be found that: in each ITerations, the parameterized value will be updated, but in the multiple block cycles of a single ITerations, the parameterized value obtained each time is the same, and the problem arises: if each block block Does the loop also get different values?
After checking the information, I found that it can be done through parameterized settings.
Open the parameterization settings box
Among them, Update value provides three options:
Each ITeration: Update parameter values each iteration.
Each occurrence: Every time this parameter occurs, update the value of this parameter.
Once: Take it only once, and use it like this all the time.
After seeing this, decisively use the Each occurrence method, and wait for the operation to be successful~
The red prompt tells me that the script has not been run. I looked carefully and found the cause of the problem:
Since the parameterization strategy is to retake the value every time it appears, different values will be called in the find function and the actually called function, so the checked value and the actual running value will always be different. .
How should this situation be resolved?
Parameterization is also used, but the checked function and the running function must use the same parameter, but cannot be configured with the same parameter. It can be solved by the following methods:
Redefine a parameterized variable "check" for the check function, and set it as follows in its parameter configuration:
Select the parameterized data table that needs to be run
Select next row strategy using "Same line as NewParam"
After re-running it, I found that the error is still reported:
After analysis, since the check is the same line with "NewParam", and NewParam is run later, this will cause the check to always be half a beat slower. So these two variables were swapped: the check variable was parameterized and Update value=Each occurrence, the NewParam variable was same line wITh "check", and it was re-run and found that there was no error.
Finally, I would like to thank everyone who has read my article carefully. Reciprocity is always necessary. Although it is not a very valuable thing, you can take it away if you need it:【保100%免费】
Software testing interview applet
The software test question bank maxed out by millions of people! ! ! Who is who knows! ! ! The most comprehensive quiz mini program on the whole network, you can do quizzes on your mobile phone, on the subway or on the bus, roll it up!
The following interview question sections are covered:
1. Basic theory of software testing, 2. web, app, interface function testing, 3. network, 4. database, 5. linux
6. web, app, interface automation, 7. performance testing, 8. programming basics, 9. hr interview questions, 10. open test questions, 11. security testing, 12. computer basics
Document acquisition method:
This document and video material should be the most comprehensive and complete preparation warehouse for friends who want to engage in [software testing]. This warehouse has also accompanied tens of thousands of test engineers through the most difficult journey. Hope Can help you too! All of the above can be shared, click the small card below to receive.