For testing scripts, you can also use the JavaTest JavaSampler to produce
samples with any desired values in the sample fields. Might be useful for
testing your regex.
For checking variables, I do much the same as Mike suggested, except I
change the JavaTest Label to something like:
var1=${VAR1} var2=${VAR2} thread-${__threadNum}
which then appears in an Assertion Results Listener.
[If the SamplerData field is populated, that appears instead of the Label in
Assertion Results]
Or you can use View Results in Table - this shows the Label in the URL
column.
There's more than one way to do it!
As to the regex, I agree with Mike, I think you need to move the
parentheses.
- (\d) will return a single digit
- (\d+) returns as many digits as there are in sequence.
--
The opinions expressed herein are my own, and are not necessarily endorsed
by my employer ...
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: 18 July 2003 03:11
To: JMeter Users List
Subject: Re: using the regular expression extractor to obtain a form
value
You could name your sampler something like:
sampler_${questionID}
Then, in the View Results Tree, the name of the sampler appears, and you can
see
what questionID got set to. I would recommend making your default value
something
more obvious, like "failed!"
Also, shouldn't your regex look like this:
input value="(\d{1,3})" name="questionID"
I'm not positive about that as I'm not an expert on regexes, it's just
something I noticed
about it - that maybe the whole value needs to be in the parentheses? I
know when I
do .*, I use (.*) rather than (.)*, which seems analogous.
-Mike
On 17 Jul 2003 at 13:53, luke cassady-dorion wrote:
> using jmeter 1.9.RC3 (yesterday afternoon's source) on windows
>
> i'm trying to use the regular expression extractor to obtain the value
> of a hidden form element, which i then use as part of a condition
> evaluation (using cyrus montakab's IfController controller). i'm not
> sure why but for some reason it appears that the value i'm extracting is
> not getting set.
>
> the form value looks like (where n 0<n<=999):
>
> <input value="n" name="questionID" type="hidden">
>
> and the values i'm using with the regex extractor are
>
> reference name: questionID
> regular expression: input value="(\d){1,3}" name="questionID"
> template: $1$
> match no: 0
> default value: 1
>
> then i have a series of IfController controllers using conditions along
> the lines of: ${questionID}==1
>
> none of my IfControllers appear to execute, so i'm guessing that the
> value is being set to something other than a digit. does anyone have any
> ideas what could cause this? is there a way to debug the process and see
> the value being set?
>
> thnx
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
--
Michael Stover
[EMAIL PROTECTED]
Yahoo IM: mstover_ya
ICQ: 152975688
AIM: mstover777
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]