Asvhini
Asvhini

Reputation: 55

Jmeter not showing JSON response

I am not sure, if I am missing something but unable to find on google as well. I am looking into some features of Jmeter. I used postman as well. We have API POST request and it returns JSON response.

While hitting my API from Postman, I am getting 'JSON' response. (i.e. no issues) and API triggers my service.

Now, if hit from Jmeter. Response if 200 and my service trigger too. But in response I am getting some code or key rather JSON values.

Like 'e5e9e97a9ba2144b448c8b150498b5a0'.

Sample HTTP Request:
Thread Name: First_API_Test 1-1
Sample Start: 2019-03-28 15:48:33 IST
Load time: 7608
Connect Time: 0
Latency: 7608
Size in bytes: 492
Sent bytes:0
Headers size in bytes: 127
Body size in bytes: 365
Sample Count: 1
Error Count: 0
Data type ("text"|"bin"|""): text
Response code: 200
Response message: HTTP/1.1 200


HTTPSampleResult fields:
ContentType: application/json;charset=UTF-8
DataEncoding: UTF-8

....
</requestHeader>
  <responseData class="java.lang.String">e5e9e97a9ba2144b448c8b150498b5a0</responseData>
  <responseFile class="java.lang.String"></responseFile>
  <cookies class="java.lang.String"></cookies>
...

Expected result from Postman is:

{
    "outgoingFileId": "25808",
    "status": "Generated",
    "createdDate": NA,
    "reconcileStatus": null,
    "failureMessage": NA,
    "successMessage": NA,
    "executionTS": 1552912975190,
    "nextPayload": "{\"presentTS\":1553696530996,\"lastExecution\":1552912975190}"
}

Upvotes: 2

Views: 2705

Answers (3)

Corey
Corey

Reputation: 60

Not sure if this was OP's issue, but I had an issue seeing response JSON because I had the dropdown above the request list in my results tree set to "Text". If I change it to "JSON" I can see the results.

Upvotes: 0

Asvhini
Asvhini

Reputation: 55

I think. I missed. I was using latest version 5.1.1.r1855137 Under Http request by default option 'Save response MD5 Hash?' was checked. 'un-check' resolved the issue.

Upvotes: 0

Ori Marko
Ori Marko

Reputation: 58774

This is caused because in Advanced tab of HTTP Request Save response as MD5 hash? is checked (you want to uncheck it)

Save response as MD5 hash? If this is selected, then the response is not stored in the sample result. Instead, the 32 character MD5 hash of the data is calculated and stored instead. This is intended for testing large amounts of data.

Upvotes: 3

Related Questions