Q: How to Read the response from Jmeter command prompt console and store in a variable in Beanshell script How to Read the response from Jmeter command prompt console and store in a variable in Beanshell script
For Ex:-
I want to read a path which is displaying in console after running SQL Query, SO I want store that value in variable
SELECT VALUE FROM RBT_PROPERTIESS WHERE PARAM='RUN_PATH' AND TYPE='CAL';
/data/RRT/RRT_cal/

A: If you need /data/RRT/RRT_cal/ (which looks like the folder where your JMX file lives in) bit following Beanshell code snippet can help. It uses FileServer class getBaseDir() method which returns location relative to which file paths are being generated.  
import org.apache.jmeter.services.FileServer;

FileServer fs = FileServer.getFileServer();
String baseDir = fs.getBaseDir();
vars.put("BASEDIR",baseDir);

or alternatively you can use user.dir Java System property which returns user working directory
String userDir = System.getProperty("user.dir");
vars.put("USERDIR", userDir);

See How to use BeanShell guide for more examples and tecnhiques
