0
votes

Number of Threads (users): 10 Ramp-up Period (in seconds): 1 Loop Count : 2

Result - When I ran the test it shows 40 samples rather expected count was 20 . I want to ask what could be the reason behind 40 samples .

Number of Threads (users): 10 Ramp-up Period (in seconds): 1 Loop Count : 1

Result - When I ran the test it shows 20 samples rather expected count was 10 .

Error - I tried to compute but I can't understand how it is doubling the user count every time

1
Can you post your test plan?vins
where does it show number of samples? do you refer to some listener?Kiril S.
I have used: HTTP Requests Default Thread Group Cookie Manager View Result Tree, Summary Report,Response Time GraphN.jain

1 Answers

0
votes

It just means that every your thread sends 2 requests instead of 1 expected. If you use HTTP Request sampler, then I can bet that you have "Follow Redirects" option enabled and send requests to resource that answers with 3xx response code. Adding some listeners like View Results in Tree/Table to your Test Plan (on debugging phase at least) would be a good idea. It really helps to check what exactly Jmeter sends/receives.

UPDATE: Response with 301 response code is a recommendation for your client (browser, jmeter, etc) to move to resource defined by "Location: " response header. So, all popular browsers (and Jmeter by default) automatically forward to this location. That's exactly your "doubled" request. If responses with 301 code is really your case, then you can do one of two things: 1. Disable "Follow Redirects" checkbox that displayed in Jmeter HTTP Request sampler settings right under the input where you enter Path: Follow Redirects checkbox

But in this case you'll request not the destination page that originally displayed for this URL in your browser, because 301 responses don't contain body, only headers.

  1. Request not the original URL that answers with 301 code but the final location instead (check your response headers and find the value in Location header).

2nd option is better (by my mind) as it produces a load to an object you really expect. But, of course, it depends on your goals.