Dear Rigas and JMeter Users:
Perhaps this topic from our internal documention will help:
---------------------------------------
Checking variables while test plan runs
Problem
You want to check that variables have the expected values while JMeter runs the
test plan. The variables could be defined in an element (User Defined Variables
element, User Parameters element, Regular Expression Extractor element) or by a
function (__regexFunction). A variable value could be hard-coded, constructed
from one or more variable values, or extracted from an HTTP response by a
regular expression.
Solution
To display a variable value while a test plan is running, follow these steps.
1. Add a Java Request element (a Sampler) to the test plan after the point
in the test plan where the variable is defined by an element or a function.
2. In the Java Request, do the following:
a. Set the Label parameter to display the variable name and variable
value. For example:
MyVariable: ${MyVariable}
b. Set the Status parameter to "OK" or "FAIL".
"OK" allows the test plan execution to continue.
"FAIL" forces test plan execution to stop.
3. Add a View Results in Table element (a Listener) to the test plan.
4. Run the test plan.
The View Results in Table element displays the Java Request response
with the variable name and variable value.
---------------------------------------
Also see JMeter User Manual, section 15.1.4, "Java Request" here:
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Java_Request
Sincerely yours,
Kyle
-----Original Message-----
From: Rigas [mailto:[EMAIL PROTECTED]
Sent: Friday, February 25, 2005 9:55 AM
To: JMeter Users List; sebb
Subject: Re: JMeter: How to reference a regexp
Hi sebb
What exactly is a JavaTest Sampler? I could not find it in JMeter but sounds
very useful because I want to be testing the values of regular expressions.
I have checked everything else but could not find a solution
> On Fri, 25 Feb 2005 14:59:08 +0200, Rigas <[EMAIL PROTECTED]> wrote:
> > Hi there,
> > I seem to be having a problem referencing a regular expression - It's
the
> > second time I m doing something with regexp and don't know what's wrong
> >
> > I have the following regular Expression Extractor under an HttpRequest
under
> > a Thread Group
> >
> > Reference Name: subsectionid
> > Regular Expression: parentId=(\d*).*subsection1
> > Template: $1$
> > Match No: 0
>
> This means select a random match - is this intended?
>
> > Default Value: -1
> >
>
> Otherwise looks OK.
>
> > Then in another Request I have a parameter checksubsections with the
value
> > ${subsectionid_g1}
> >
> > PROBLEM: When I check the results tree, after I run the test, in the
request
> > I see checkSubsections=${subsectionid_g1}, which means that it somehow
does
> > not recognise that this is a variable. What am I doing wrong?
>
> Are both the samplers in the same thread group?
>
> Are the variables spelt exactly the same (case matters)?
>
> Try adding a JavaTest sampler immediately after the original Http
> sampler to check the value(s) of the Regex variables.
>
> > Thanks in advance
> >
> > Rigas
> >
> > ---------------------------------------------------------------------
> > 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]
>
---------------------------------------------------------------------
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]