1
votes

Please VOTE TO CLOSE instead of downvoting. I can't delete the question now that there are answers for it.

I've been playing with JMeter a few days now and I'm starting to get into the steeper part of the learning curve it seems. I've added a login request (i had to put it in a Loop Controller in the Thread Group). I then have a cookie Manager followed by two requests that are made by the browser (according to fiddler) after logging in. These next two requests require a cookie though and they don't seem to be working right now. I've set the Cookie Manager to "compatibility" for Cookie Policy. Then I look at the view results tree and I see that the two requests after login are failing and in the Request tab I see "[no cookies]".

Rather perplexing. Here's a screenshot.

screenshot.

i've modified my login request a bit:

enter image description here

however the next request still fails with a "not logged in" and "forbidden" message:

enter image description here

3
Post should be deleted as title is misleading and issue is just due to beginner errors.user1565007
I can't delete it once there are answer. Instead of downvoting, just vote to delete.Ramy
I don't have this optionuser1565007

3 Answers

1
votes

Not sure as i don't have full test plan but your login request seems to have failed because you get a redirect from http to https in tree result.

As you can see in tree you have 2 samples inside Login one with http then one i http.

I suggest if you are a beginer to read this :

It will help you build easily yoyr test plan.

I you don't succeed with proxy then I suggest you remove loop controller and test with only one iteration to see what's happening. You can click on sampler in tree result and select request tab.

Check that your login request is using https, it's in scheme of http sampler.

If it's a redirect that you cannot anticipate, then disable follow redirect and with a regexp post processor:

extract the url from the redirect and submit it with login and password in next http sampler.

Regards

0
votes

I had to learn a little bit more about the requests being made to the system in order for this to work. Instead of a call to www.server.com/login, i made a request to www.server.com/sessions.json and provided a json file with username and password. doint this set the cookie and the cookie manager took over. Then without modifying the other two requests, everything was honky dory.

-1
votes

Based on the images that you have posted, I found the error. Cookie manager should be under the scope "Test plan". You have created a Cookie manager with the scope HTTP request. Please leave the HTTP Cookie Manager with the standard settings. It should work. enter image description here

For more details refer to the below JMeter Documentation http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager