2

I am trying to test my Springboot App using jMeter. I want to send multiple request with some JSON payload to receive the response concurrently (via threading).

While doing this, in order to check validity of response, I want to keep a log where it can show the request-response pair (side-by-side or even in separate files, they should just be identifiable which request gave which response).

This is to test if one request is not tampering other request's response (data validation).

I have already tried Simple Writer tool where we can log request and response (I think jmeter have used some different terminology in menu) on configure menu. But it doesn't seem to be working when I run the results.

So my main concern is how can we store the JSON request data and response data pair somewhere after test iteration have completed. I have never used jmeter before so a little bit of detailing will help.

Thanks!

Michael Kemmerzell
  • 4,802
  • 4
  • 27
  • 43
Jeff
  • 23
  • 4

2 Answers2

3

You can use Flexible File Writer which gives you the full freedom with regards to what and where to store.

For example if you configure the Flexible File Writer as:

enter image description here

I'll provide textual form of the sample template:

---------REQUEST----------------------\r\n|requestData|\r\n---------RESPONSE--------------------\r\n|responseData|\r\n-------------------------------------

You will get results file looking like:

---------REQUEST----------------------
POST https://jsonplaceholder.typicode.com/posts

POST data:
{
    "title": "foo", 
    "body": "bar",
    "userId": 1
}

[no cookies]

---------RESPONSE--------------------
{
    "id": 101
}
-------------------------------------

You can install Flexible File Writer plugin using JMeter Plugins Manager

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
  • Thanks a lot. I will try it out and get back here to let you know how it went. I will make sure to upvote this once i get enough karma. – Jeff Jan 31 '20 at 04:34
2

Check out the JMeter docs on configuring the Results Tree. It will show you the results and you can configure how much to keep and where. https://jmeter.apache.org/usermanual/component_reference.html#View_Results_Tree

In particular you might benefit from this: https://jmeter.apache.org/usermanual/component_reference.html#Save_Responses_to_a_file

Joe W
  • 2,773
  • 15
  • 35