facing a problem as below
I have a http request & in response header, I am getting a key, value as range: items=0-99/3876. how to extract the range 0,99 & 3876 as jmeter variable from postprocessor (like regular expression).
I want to create a loop which runs for like 39 times (which is like round to the no 3876) to next 100/1000's to vary the range as 0-99,100-199, ... to 3800-3900.. for next http requests in loop with the counter. which increments by value of 100.
I have gone with the below procedure:-
- http sampler to get the response header :- range: items=0-99/3846
- extracted the values 0,99 & 3846 as jmeter values from different regular expressions extractor (which should have been done by single processor only)
- Want to get the loop count value as 3846/100 == 38 +1
- Now setting the counter with starting range as 0 with increment value of 100 & ending range as 99 with increment as 100 from the jmeter variables.
- now implement the counter variables as http header foe all the next headers.
Given you have the following JMeter Variables:
you can use __jexl3() function to calculate dynamic number of loops like:
the function can be placed directly to the Loop Controller's "Loop Count" input:
this way given your data Loop Controller will run its children 39 times.
If you want to configure a Counter it would be something like:
See How to Use a Counter in a JMeter Test article for more details if needed.
The variable declared in the Counter can be used in the HTTP Header Manager: