2

There doesn't appear to be a way to access the latest HTTP Response? I've had to create a REGEXP extractor as a bean postprocessor to HTTP requests in order to store the LAST_RESPONSE then extract it from the vars as needs be?

I feel like I've missed something fundamental along the line wrt to the context/scope of the response...

I understand it's a load testing tool but I've found it to be fairly useful for automation jobs as well.

thanks, Mark.

enter image description here

Mark Gargan
  • 831
  • 1
  • 9
  • 21

1 Answers1

1

According to the How to Extract Data From Files With JMeter you might want to add ^ character to represent line start so regular expression would look like:

(?s)(^.*)

If you want to go the Beanshell PostProcessor you can achieve the same with the following code:

vars.put("LAST_RESPONSE", new String(data));

where:

  • vars - shortcut to JMeterVariables class instance which gives read/write access to all JMeter Variables in scope
  • data - byte array which contains parent sampler response

In both cases you will get ${LAST_RESPONSE} JMeter Variable which will be holding parent sampler response data.

Dmitri T
  • 159,985
  • 5
  • 83
  • 133