Marek R
Marek R

Reputation: 37900

JMeter different results during replay of test

I have a strange problem with JMeter.
I've made recording of some sort of web application without any problems. Problem appears during playback of test. For some reason I receive different results during playback than during recording.

When I compare Http Request made during recording and playback I don't see a single difference (except for some security token which I'm extracting from earlier requests and passing as parameter). To be more exact during recording I receive a response with a big body (>5kB), and during playback body of response is empty. Response code is 200 (OK). This body contains crucial data from database, so I'm afraid that measurement made by this JMeter script will not reflect actual behavior of application, simply I will not measure what I really need.

Now my questions:

  1. is there some tool or JMeter plug-in which will allow more effectively see contents of HTTP requests and its responses? It would be great If I could compare of requests made during recording and playback. So far I used two listeners: "View Results Tree". I've sandwiched between them to compare request from recording and playback.
  2. is there some known bug in JMeter which could explain the difference? For example something related to recording process?

Here is example of request:

POST http://10.133.27.81:8080/c/portal/render_portlet

POST data:
p_l_id=69210&p_p_id=blank_WAR_Blank_INSTANCE_iNM3&p_p_action=0&p_p_state=normal&p_p_mode=view&p_p_col_id=column-2&p_p_col_pos=1&p_p_col_count=2

[no cookies]

Request Headers:
Connection: keep-alive
Content-Type: application/x-www-form-urlencoded
Accept-Language: pl
Accept: */*
User-Agent: Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)
csrf_token: 1GXK-0QD7-GFPJ-JLDG-JP2G-J390-BFLG-7LL7
Pragma: no-cache
Method: POST /c/portal/render_portlet HTTP/1.1
X-Requested-With: OWASP CSRFGuard Project
Referer: http://10.133.27.81:8080/group/bou
Accept-Encoding: gzip, deflate
Content-Length: 143
Host: 10.133.27.81:8080

Update: to make sure which headers or parameters are constant I made 4 recordings of same test case during different sessions and compared them, so I'm quite sure that only csrf_token has to be field with value fetched from other request. I've added debug sampler to verify that this value is fetched properly.


Update 2: Problem found.
There where two problems:

  1. There is a bug in JMeter when you do a search (Ctrl-F) it searches the whole project except for HTTP Header Menagers and my request contained csrf_token inside of header (I detected that before posting this question). Making a search in xml using text editor was good workaround for that.
  2. when I try to find source of problems, before I've found problem number one, I've added a new problem by removing a HTTP Cookie Manager (I'm blaming myself and IE for this).

Generally changing Internet Explorer to FireFox with HttpFox add-on help to spot the problem.

Thanks everyone for support.

Marek

Upvotes: 0

Views: 2208

Answers (2)

Marko Bonaci
Marko Bonaci

Reputation: 5706

Response code 200 doesn't have to mean that everything went well at the application level.

To find out more details you can use Debug sampler and Debug PostProcessor.
Example here.

Upvotes: 1

UBIK LOAD PACK
UBIK LOAD PACK

Reputation: 34536

Your issue comes certainly from a missing dynamic request parameter that you didn't compute.

Look for example at csrf_token header Did you make it variable? Or do you transmit its initial recorded valur, but also at any parameter that contains some hashdata or numeric data referencing some content that does not exist in your page or request.

For example col pos I see p_p_col_id and related parameters, are you sure they reference something in your replay.

There is really very little chance of a JMeter bug in this case.

Upvotes: 0

Related Questions