Hey, I think I'm narring down on how this works....it is kind of odd....
The problem I was having was - where do you stick your regular expression
function to get the data? I put it in the response to an http request. Logic
being, where else are you going to put it? It has to parse the current
response to populate the variables you want right? It couldn't go back and
parse through all the previous responses right? Well, my tests seem to say
differently....
We use struts. I call actions with a .do extension. These forward to jsps.
If I put the response assertion with the regular expression function on the
struts call, it doesn't work. But if I call the jsp directly afterwards it
does. Here's the tricky part. I'm not keeping these variables in the
session. They are of the scope 'request'! If you look at the response of the
jsp the data is not there obviously but the response assertion with the
regular expression function is on that jsp response. And this is working?!?!
Why? This tells me that regular expression function is not parsing just the
last response but apparently all previous responses (correct?). I match on
just the first one.
Is this correct? Cuz if this is so, I can just add a response assertion
anywhere with my regular expression function as long as it follow 2 rules;
1) It comes AFTER the request to get the data (if it is a struts.do you can
just add a response assertion to it because it does not parse it correctly)
2) It comes BEFORE where you want to use the variable.
Example;
This does not work;
http request to a struts.do
response assertion containing regexp function putting value in
${receiptID} (I use a NOT on this assertion so it will not show as a
failure)
http request to different struts.do using ${receiptID}
This does;
http request to a struts.do
http request to the jsp file that the struts.do forwards to
response assertion containing regexp function putting value in
${receiptID}
http request to different struts.do using ${receiptID}
If you have the regexp function not throttled using the first occurrence
(chosen using the third parameter to the function) would it just go through
all the previous responses?
thanks,
Michael Lee
----- Original Message -----
From: "Mike Stover" <[EMAIL PROTECTED]>
To: "JMeter Users List" <[EMAIL PROTECTED]>
Sent: Tuesday, February 04, 2003 3:04 PM
Subject: Re: pull value from response and put in future request
> Typically, you put the regex function in the request you want to use it
in.
>
> If your case is overly complicated, then the assertion idea may work - you
could try putting
> the regex in the name field (and you could use an assertion, or a timer,
or any empty config
> object attached directly under the request). It is messy, and I'm right
now working on a better
> option :-)
>
> -Mike
>
> On 4 Feb 2003 at 14:45, Michael C. Lee Jr. wrote:
>
> > Im using 1.8.1. I got it to work in one case. What I did was create a
> > reponse assertion and added it as a NOT ${_regex.....
> > I added it to another case and the regular expression didn't match for
some
> > reason....still looking but got one case to work.
> > I put receiptID as the variable name as parameter 6.
> > My question really is, where is a good place to put the regular
expression
> > so it grabs the variable for the next http request? Should it be in a
> > response assertion as a not? That's where I put it.
> >
> >
> > ----- Original Message -----
> > From: "Mike Stover" <[EMAIL PROTECTED]>
> > To: "JMeter Users List" <[EMAIL PROTECTED]>
> > Sent: Tuesday, February 04, 2003 2:29 PM
> > Subject: Re: pull value from response and put in future request
> >
> >
> > > If you are trying to access your variable as ${receiptID}, then you're
> > probably
> > > running JMeter 1.8, and it's not working. It would work under JMeter
> > 1.8.1. To get
> > > it working immediately for you, you probably need to access the
variable
> > as
> > > ${receiptID_g1} (g1 stands for "group 1", which you appear to be
looking
> > for).
> > >
> > > -Mike
> > >
> > > On 4 Feb 2003 at 14:06, Michael C. Lee Jr. wrote:
> > >
> > > > How can I pull a value from a response, put it in some variable and
use
> > that variable in a future post/get http request? I've read through the
> > documentation and tried to do it using the regexFunctoin but cant get it
to
> > work
> > > >
> > > > ${__regexFunction(receiptID%3D%28.*%29%22,%241%24,1,,277,receiptID)}
> > > >
> > > > That is the expression I have.
> > > >
> > > > I want to go to a search page to search on receipts and get a list
of
> > receipts back in a series of URLs. At the end is
....?receiptID=12345"....
> > > > I want the 12345 put in a variable called receiptID. Then I want to
call
> > another page with that variable as one of the parameters.
> > > > Help!
> > > > Mike Lee
> > >
> > >
> > >
> > > --
> > > 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]
> >
>
>
>
> --
> 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]