I have used BSF Postprocessor to parse json in one of my jmeter test files. My code is as follow.
eval('var response = '+prev.getResponseDataAsString());
vars.put("userAccountID", response.ID);
But i have found that BSF post processor reduces Jmeter's performance. So i am going for JSR223 Post processor. I need to know what is the corresponding code for above in JSR223 (JAVA language). Thanks in advance;
I suggest to use jsr223 assertion and javascript. Then you can just simply check and parse your data. for example:
var response = SampleResult.getResponseDataAsString();
var jsonOutput = JSON.parse(response);
Now you can simply operate on "jsonOutput".