Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to format JSON response in Jmeter?

Tags:

jmeter

How can I format json response in jmeter? I don't want to tell which part of json answer should be showed. I want to see my response not as very long one line but as many lines formatted with new lines and tabs/spaces.

I saw:

http://eclipsesource.com/blogs/2014/06/12/parsing-json-responses-with-jmeter/
http://stackoverflow.com/questions/18562060/jmeter-extracting-fields-parsing-json-response

Thanks in advance!

like image 984
Krzysztof Avatar asked Jun 20 '16 21:06

Krzysztof


People also ask

How to get response in JSON format in JMeter?

Another way is to install a JMeter plug-in which allows to use JSONPath to access specific elements in JSON. Similar to XPath for XML, JSONPath offers a simple expression syntax to navigate through JSON objects. The JSON Path Extractor is an open source plug-in which adds a post processor for JSON responses to JMeter.


1 Answers

I believe JSON Formatter PostProcessor is what you're looking for

JSON Formatter PostProcessor

If it is not suitable for you - take a look at JSR223 PostProcessor, it provides prev pre-defined variable (basically SampleResult instance) which gives read/write access to the parent sampler(s) response data so you will be able to do anything you want with the response using Groovy language

like image 199
Dmitri T Avatar answered Oct 23 '22 05:10

Dmitri T