Jmeter variable from response

breedish picture breedish · Sep 6, 2010 · Viewed 23k times · Source

Is it posible to bind to a variable value from response and then pass it as parameter to other http request?

Answer

JoseK picture JoseK · Sep 7, 2010

The earlier answer to this is hopelessly outdated.

Using the Post-Processor > Regular Expression Extractor, it is quite simple to extract any portion of the response.

The newer versions of JMeter also have Reg Exp tester options in the Listener > View Results in Tree, so you can perfect the regex till it does exactly what you want it to.

also see Passing variable from one http request to another in Jmeter


Earlier Answer:

It should be possible to extract an element from the response using the Regular Expression Extractor and store it in a variable which can be referred from further requests.

See Extract multiple strings on http://wiki.apache.org/jakarta-jmeter/RegularExpressions and this example http://jmeter-tips.blogspot.com/2010/06/tip-12-how-to-add-http-request-sampler.html

The official docs on this topic are this heading 19.5.1 __regexFunction