jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carl Nygaard" <cnyga...@hmc.edu>
Subject Re: JMeter __regexFunction
Date Fri, 07 Jul 2006 16:34:04 GMT
As for Geoff's advice:
Geoff has sent me a jar to try out -- thanks Geoff, i'll certainly
give that a try.  In an ideal world i won't need to add any jars to
JMeter, since this script will likely be running on various computers
and the less that needs to be kept track of the better.

As for Ricardo's advice:
I have considered using the RexEx post process as you mentioned.  How
would you suggest I join all the matches together, when there can be
up to n of them?  Can this be done in javascript or using some other
trickery?

Thanks,
Carl

On 7/7/06, Richard <rdalinger@siu.edu.ar> wrote:
> 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.
>
> Regards
>
> Dalinger Ricardo
> Toba Programmer
> SIU - Ministerio Educaci¨®n y Tecnolog¨ªa
> Argentina
>
> 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: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>
Mime
View raw message