0
votes

I have generated a jmeter script. But I'm not getting anything in response data (View tree listner). I'm getting Response code: 302 and Response message: Moved Temporarily in response header (View tree listner) also giving the URL to which it is redirected in Location field in response header. I want this redirected URL to beenter image description here displayed in response tab.

the url i wnat in response data]1

1

1 Answers

2
votes

You can fetch the URL using Regular Expression Extractor.

  1. Add Regular Expression Extractor as a child of the HTTP Request sampler
  2. Configure it as follows:

    • Field to check: Response Headers
    • Reference Name: JMeter Variable name of your choice, i.e. location
    • Regular Expression: Location: (.*)
    • Template: $1$

      Regular Expression Extractor Location Header

  3. You will be able to access the extracted URL as ${location} or `${__V(location)}} where required.

See Using RegEx (Regular Expression Extractor) With JMeter article for more information on correlating dynamic values in JMeter test.