I have a problems while picking up variables set by the Regular Expression Extractor in a Beanshell.
The result of Regular Expression Extractor:
JMeterVariables: JMeterThread.last_sample_ok=true JMeterThread.pack=org.apache.jmeter.threads.SamplePackage@120cc173 START.HMS=090316 START.MS=1507255396987 START.YMD=20171006 TESTSTART.MS=1507266934916 returnLink=not found returnLink_1=/tripper/payment/info?booking=KD6YGS4L8I returnLink_1_g=1 returnLink_1_g0="returnLink":"/tripper/payment/info?booking=KD6YGS4L8I" returnLink_1_g1=/tripper/payment/info?booking=KD6YGS4L8I returnLink_matchNr=1
Now I want to using returnLink_1 in Beanshell, but I cannot get And print it out. Actually, I want to get "KD6YGS4L8I" from the string but I can't.
int size = Integer.parseInt(vars.get("returnLink_matchNr")); // to get size of matched values log.info("size is:" + size ); // you can remove log stmts once it is working String url = vars.get("returnLink_1"); log.info("link:", url); vars.put("BookingCode",url); // store in Booking code and use for next thread
I'm a newbie in JMeter. Please help me.