jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard <>
Subject Re: JMeter __regexFunction
Date Fri, 07 Jul 2006 14:20:41 GMT
Have you tried with a RegEx post processor?. Maybe this could help you
RegEx conf:

Reference Name: VarName
Regular Expression: <option value="([^"]*)" selected>
Template: p=$1$
Match No.: -1
Default Value: your default value

Once you've set this.... in the test the RegEx set the next variables:

VarName_matchNr - the number of matches found; could be 0
VarName_n, where n = 1,2,3 etc - the strings as generated by the template

So with VarName_n you can access the matches, in your example:
VarName_1 ==> p=a
VarName_2 ==> p=b

You have to join them and add to the parameter list.


Dalinger Ricardo
Toba Programmer
SIU - Ministerio Educación y Tecnología

Carl Nygaard (カール) wrote:
> I have faith in JMeter; I just know there is some way to do this.
> I'm trying to do an http post request.  The post is based on a form
> that can have a variable number of parameters.  These parameters are
> caused by html like this:
> <select name="p" multiple id="p">  <option value="a"
> selected>a</option>  <option value="b" selected>b</option> ...
> Note that everything is on one line.  I would like to match every one
> of the possible values in the form and submit them as selected.
> I hunted through the mailing list archives and found that the
> __regexFunction is a handy way to get around the problem of not having
> a variable number of parameters.  So I made this up:
> ${__regexFunction(<option value="([^"]*)"
> selected>,p=$1$,ALL,&,,variableName)}
> My hope was that this would result in the expression:
> p=a&p=b
> which could be added (with some trickery) to the parameter list of the
> request.  What i get is this:
> p=a
> It only matches ONE of the expressions, not all of them.  I assume it
> is because they are all on the same line, but despite my attempts to
> use fancier regular expressions, I simply can't get it to match all of
> them.  Does anyone have any ideas how to do this?
> Thanks,
> Carl
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message