Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Save response data into variable in JMeter

Tags:

jmeter

How can I save all response data into variable in JMeter? I'm trying to use BSF PostProcessor to get response, but I don't know function to get response.

I want to make something like:

vars.put("myResponse", getResponse()); 

Response data like that:

{"album_id":873,"total":3}
like image 584
InkStyle Avatar asked Nov 05 '12 16:11

InkStyle


1 Answers

Here's what you can do in Beanshell:

response = prev.getResponseDataAsString();
vars.put("variableName", response);
like image 138
Andrei Botalov Avatar answered Oct 17 '22 03:10

Andrei Botalov