Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jmeter variable from response

Tags:

java

jmeter

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

like image 730
breedish Avatar asked Sep 06 '10 15:09

breedish


1 Answers

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

like image 80
JoseK Avatar answered Oct 13 '22 08:10

JoseK