3

I am new to jmeter. I have been experimenting on creating a jmeter script manually by inspecting the network log from chrome developer tools rather than directly recording the HTTPS script recorder due to certain restrictions.

I have encountered a json Post request that has some query string parameters along with a request payload parameter. I have added the appropriate headers including the Content-Type: application/json header. But I am confused on how to pass both the query string parameter and the request payload in a single request. I am not sure if I should mix the request payload parameter along with the query string parameter and send it in jmeter body data tab.

Pointers appreciated!

Arun
  • 33
  • 1
  • 4

2 Answers2

3

There is nothing wrong in having both parameters and body data, just make sure to append the parameters to the "Path" section and provide your JSON payload using "Body Data" tab:

enter image description here

As you can see JMeter normally sends the request

enter image description here

Also be aware that you don't have to manually populate HTTP Request samplers, using JMeter's HTTP(S) Test Script Recorder will make your life easier as JMeter provides record-and-replay functionality (of course most likely you will need to perform correlation, however the effort will be less). Alternatively you can consider using JMeter Chrome Extension which is even more fast and easy as you won't have to worry about proxies, certificates, etc.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133
0
  1. In the HTTP request open the "Body Data" tab and add the payload request

    for example:

{
  "filters": [
    {
      "id": "360",
      "name": "360T",
      "field": "name",
      "fieldName": "Name"
    }
  ],
  "orderBy": "asc",
  "sortBy": "name",
  "page": 0,
  "rowsPerPage": 10,
  "search": ""
}
  1. Add HTTP Header Manager Insert name:Content-Type ; Value: application/json
Iziksh
  • 119
  • 1
  • 1
  • 8