If your app is using cookies to store the session and your test plan is not
sending the SESSIONID correctly in this ajax call then the chances are there
is a previous request that is wrong and this request is not setting the
cookie as expected (so it never gets sent back properly even if you do have
a HTTP Cookie Manager). You probably need to look further back in your test
plan to see why it is not getting the correct Set-Cookie response. This
could be for all sorts of reasons. 

Basically, you need to do a bit of digging using the View Results Tree
Listener and also in a browser to see where the Set-Cookie should be
received and why JMeter is not getting it. You might find that this earlier
request is getting an error in response but that the response code is still
200 so it appears as 'green' and gets passed by JM. In this case, try adding 
http://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
Response Assertion s to your requests.

To help you, try going through each of these:

http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Cookie_Manager
HTTP Cookie Manager 
As far as I am aware, this control is (relatively) straight forward. Taking
it down to the basics, it will read Set-Cookie instructions (in the server
responses) and act upon them creating the required cookie in memory and
sending it with subsequent requests. There's more to it than that, but
that's the basics.

You need to make sure that it is in the correct scope. You can usually put
just one at a fairly high level in your test plan and that should do the
trick.

You can manually add cookies using this control.


http://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree
View Results Tree 
You probably already are but use this to see what is being sent and received
for each request,


http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Header_Manager
HTTP Header Manager 
Predictably, this sets headers. You probably have lots of them as a child to
each request (assuming you used the Proxy Recorder with default options).
The thing to remember here is again, scope, but also that multiple header
managers can be combined - if multiple controls are in scope then each
header value will be appended to the request.

You can manually specify extra headers here or edit recorded values.


http://jmeter.apache.org/usermanual/component_reference.html#HTTP_URL_Re-writing_Modifier
HTTP_URL_Re-writing_Modifier 
If your application is not using a cookie to store the session but instead
rewriting the URL then this control, using SESSIONID as the Session Argument
Name will help.


http://jmeter.apache.org/usermanual/best-practices.html#proxy_server
Recording via a Proxy 
Again, I'm assuming you are already doing this but, if not, then use this
method to record requests. It will record the request along with any
headers, url params, etc.


https://www.google.com/url?url=http://jmeter.apache.org/usermanual/component_reference.html#HTTP_Authorization_Manager
HTTP Authorization Manager 
Allows you to set basic auth - if required. This probably isn't your
problem, if it were you'd likely get a 401, but who knows what weird code
you are working with - it's conceivable someone thought a 403 was a better
idea.


-----
http://www.http503.com/
--
View this message in context: 
http://jmeter.512774.n5.nabble.com/How-to-obtain-application-json-GET-responses-tp4985576p4987179.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to