1

I am executing a scenario with JMETER in which I login to the application and logout In the Thread group I use the following settings:

  1. Number of Threads: 10

  2. Ramp up Time : 20

  3. Loop count: 5

I am not using HTTP Cookie Manager Component so I should get error HTTP request when 2nd thread try to login but scenario executes cleanly without any error I want to have error when I am not using HTTP Cookie Manager Component correct me if I am wrong.

  • If you are not using cookie manager then you will get issue while logging. – Helping Hands Dec 1 '15 at 11:01
  • That is what I am saying I should get error on every second request but its not the case with me – Hassan Dec 1 '15 at 11:27
1

See, if by error you mean that you are expecting a failed request (red color request response) because of not using the Cookie Manager, then it is never the case or this is not how JMeter works. Lets say you have the following scenario:

  1. User Login (Login page)
  2. User Detail Page (accessed after successful login)

Now, for accessing the User detail page your application needs session, so you have to use Cookie Manager in your script. But, if you have not used Cookie Manager and executed your script without that, then your script result will not show any error or failed request; because when JMeter sent request to User Detail page, it will get response, but in response it will get the login page again (as there was no session so application returned the login page in response to user detail page).

That's why you will not see any error in your responses; if you dig down and see the "Response Data" tab of the "Tree Listener" then you will find that in response you have got the "Login page" where the expected was "User Detail page" hence your test case should be considered as failed.

This is how JMeter works, it send request and receive a response no matter what is the response. For verifying the response and making your test case failed, you should add a Response Assertion in your script, then it will get failed, as in that case Expected Response will not be same as the Received Response.

In addition to it, cookie manager is used to maintain session of the current thread/user, not for the subsequent threads. So, if you are not using Cookie Manager, then your each thread/user will not be able to successfully perform any operation after login which requires session, as application will not find any session Id for that. Every second thread will have its own session which will be used for performing operations it has nothing to do with session of the earlier thread session.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.