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);

1 comment:

  1. thank you for sharing this

    Oxford Migration for digital marketing
    check
    Reply

    ReplyDelete