Jmeter-While Controller
background:
As a loop controller, the most commonly used on the 'loop controller' and 'While controllers' loop controller can only define the number of cycles (forever and custom frequency) lack of ability to judge .While controller just to make up this deficiency, both circulation but also logic, let's get into an example of it.
While controller
- Condition parameters wording
First, we add 1.1 While the controller, you can see only one condition Condition
When Condition nothing to write what happens, let's try it, first add a http Sampler While the controller in
Let's run down, watch what happens
The Sampler will always execute it, it is an infinite loop.
While how to take advantage of that judgment to control it? Read on.
-
- Condition by file controller
We are coding the time with while statements when the condition is True on the implementation of the loop body statement, when the condition is false, to come out and end the cycle of knowledge of this principle can be used CSV be realized in the local file directory / Users / louiezhou / home / jmeterSpace / true.csv
add files
While at the same time added to the controller in CSV Data Set Config
Adding conditions While the controller in
BooleanValue When the value is False, it is out of the loop.
-
- Condition to use the function
Assistant to bring up the function, add the variable myValue
While setting conditions, run times less than 5
At the same time the number of assignments in the running to add http_Sampler
Tree View Results
From the Debug Sample myValue can be clearly determined value is equal to 5, in line with our value set.
There is also a loop controller called ForEach, in our previous example has been shared before, do not know a friend, please look at previous tweets.
to sum up:
Each has advantages and disadvantages cycling control, only using the appropriate controller at the right time in order to play the best results. At the same time, loop controllers work only to the part of the request, the number of iterations of its thread group is not affected .
Today recommended to read the article featured Recommended
Jmeter interface test - regular expression
Jmeter interface testing - parametric
Consultation plus micro letter
Scan QR code
Welcome to introduce ourselves and recommendations, micro-channel needs to push your resume!
Please Mengchuo two-dimensional code below to learn more