Friday, January 25, 2019

Class: JSONObject not found in namespace - Solution

When you run the jmeter and if you see the error - Class: JSONObject not found in namespace

This mean that you dont have the class in jmeter lib you mentioned in the BeanShell script. To fix this copy the jar needed and paste it under lib folder in jmeter and restart it.

Download json jar from here - https://github.com/stleary/JSON-java

Thursday, January 24, 2019

How to get response data using BeanShell post possessor

In the BeanShell post possessor the script section has the following -

ctx, vars, props, prev, data and log.

In the above, the data is byte array of the parent sampler. So we can use string class from java to construct a string from the byte array like this -

String myResponseData = new String(data);


If you want to parse json from the above string you can use the following -

JSONObject jsonObj = new JSONObject(myResponseData);

Wednesday, January 16, 2019

Curl https error

When curl says https error just change the single quote to double quote it will work.

For example -



This is windows default installed libcurl.