Good question. After a long search, I find it strange that Jmeter does not support this more elegantly and requires a pretty workaround to just send back form data received on GET's preliminary request.
I found that ShGiji answered a little harder, and he had to dig around to adjust the extent of the regex, etc. Below are the steps I have taken.
Adjust the regex extent to get parameters from a response to a GET request
To force Jmeter to create a list from the extent of the regular expression, the match number must be set to -1 (as described here ). Note that you also need to write the name and value of the parameter, so you should get something like this ...

Optionally add a debug handler . If you do this, you must confirm that there are variables prefixed with the reference name of your choice (in the above example, you should expect fieldList_matchNr , fieldList_1_g1 , fieldList_1_g2 , etc.)
Add a Beanshell post handler to add parameters to subsequent POST request form data
The following script runs on Jmeter 2.11 (the latest version at the time of writing). Note the use of Integer.parseInt , not Integer.valueOf .
Beanshell mail processor:
log.info("====================="); count = Integer.parseInt(vars.getObject("fieldList_matchNr")); log.info("Number of order details fields: " + count); for (i=1; i <= count; i++) { paramName = vars.getObject("fieldList_" + i + "_g1"); paramVal = vars.getObject("fieldList_" + i + "_g2"); log.info("Adding request parameter: " + paramName + " = " + paramVal); sampler.addArgument(paramName, paramVal); } log.info("=====================");
Simon ness
source share