Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 87214 invoked from network); 4 Dec 2003 15:21:31 -0000 Received: from daedalus.apache.org (HELO mail.apache.org) (208.185.179.12) by minotaur-2.apache.org with SMTP; 4 Dec 2003 15:21:31 -0000 Received: (qmail 28969 invoked by uid 500); 4 Dec 2003 15:21:08 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 28940 invoked by uid 500); 4 Dec 2003 15:21:08 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "JMeter Users List" Reply-To: "JMeter Users List" Delivered-To: mailing list jmeter-user@jakarta.apache.org Received: (qmail 28872 invoked from network); 4 Dec 2003 15:21:08 -0000 Received: from unknown (HELO smtpgate.tceq.state.tx.us) (163.234.36.8) by daedalus.apache.org with SMTP; 4 Dec 2003 15:21:08 -0000 Received: from GATEDOM-Message_Server by smtpgate.tceq.state.tx.us with Novell_GroupWise; Thu, 04 Dec 2003 09:21:00 -0600 Message-Id: X-Mailer: Novell GroupWise Internet Agent 5.5.7.1 Date: Thu, 04 Dec 2003 09:20:55 -0600 From: "Bob Jacoby" To: Subject: Re: Using Regular Expression Extractor Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="=_045AF9CC.38592B30" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N --=_045AF9CC.38592B30 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Thanks, it's nice to know I'm not going nuts - at least in this instance. = :) I'm still missing something - though it may be my misinterpretation of the = docs. Again, using 1.9.1 on w2k. >From the docs it sounds like I can use a single extractor to set multiple = variables and use the _g# to reference them in following = requests. For example (assumes that the reponse being parsed has the text = Java Platform in it and is on the same line), using the = following values in an extractor: Ref Name: test Reg Ex: (Java).*?(Platform) Template: $1$ Match No: 1 Default: hello I expected to be able to reference these in my next sampler http request = via: template =3D $(test) firstentry =3D $(test_g1) secondentry =3D $(test_g2) However, the following request is: Query Data: template=3Dhello&firstentry=3D${test_g1}&second=3D${test_g2}&= =3D If I modify the Reg Ex in the extractor to be (Java) rather than (Java).*?(= Platform) I get the following: Query Data: template=3DJava&firstentry=3DJava&second=3D${test_g2}&=3D I've tested my regex in another tool to make sure that (Java).*?(Platform) = does actually have a match in the response from the first request. Am I = misunderstanding the docs? Thanks, Bob >>> jsalvata@atg.com 12/03/03 05:26PM >>> Yes, I remember some modifier (now called pre-processors) that was=20 working on the result of _previous_ request to decide on some change to=20 the one where it was placed. I don't know if any of the available=20 modifiers work this way anymore... En/na Bob Jacoby ha escrit: > That's funny. I could of sworn I tried doing that before even my first = post, but alas, I must of screwed up somewhere else. I know I read a = archived email that said specifically that you were supposed to put the = regex call as a response to the 2nd request - and not the first. Oh well, = maybe that's how it used to work in an older version or I'm going = completly out of my mind. >=20 > Thanks for you help! >=20 > Bob=20 >=20 >=20 >>>>mikel@ticketweb.com 12/03/03 03:56PM >>> >=20 > Ok. I see the problem. Move the Regexp extractor to the first = sampler.=20 > The extractor gets run on the -output- of the sampler it's attached=20 > to. So, the variable isn't filled with anything in your case, until=20 > your test is done. >=20 > And in your case, you still don't need the _g1. But after rereading = the=20 > docs, it won't hurt, either. >=20 > Bob Jacoby wrote: >=20 >=20 >>I tried that and the output is just=20 >>Query Data: timestamp=3D${stamp}&=3D >>I've tried every combination I can think of to get the $(stamp}=20 >>(with/without _g1) variable replaced with _anything_ and it never is. = =20 >>:( Why would I need to drop the _g1 anyways since the manual states = that=20 >>_g1 refers to the first group? If anyone has the time to look at them = I=20 >>wrote a quick test page and a jmeter test plan to use the extractor -=20 >>which doesn't appear to work. Just put the pages in your doc root. >>=20 >>Appreciate your help! >>=20 >>Thanks, >>Bob >>=20 >> >> >>> mikel@ticketweb.com 12/03/03 03:16PM >>> >>Drop the _g1 from your variable. >> >>${stamp} >>will do what you want. >> >>Bob Jacoby wrote: >> >> > Using 1.9.1 with Sun 1.3.1 JVM on windows 2k >> > >> > For the life of me I can't figure this out. I'm sure I'm missing=20 >>something stupid, but have wasted too much time trying to figure out=20 >>what that is. I want to use the Reg Exp. Extractor to dynamically add = a=20 >>value to a http request from the response of the previous one. Per=20 >>previous posts I have a setup similar to: >> > >> > - simple controller >> > - http request >> > - http request >> > - Regular Expression Extractor >> > >> > I think i'm messing up the settings in my second http request. I=20 >>added a parameter: >> > Name: timestamp >> > value: ${stamp_g1} >> > >> > For my Reg Exp Extractor I have the following: >> > Ref: stamp >> > Regular Exp: .*(hidden?) [note - i just have this cause i know it=20 >>returns something] >> > Template: $1$ >> > Match No: 1 >> > Default Value: hello >> > >> > When I run it and look at the log file for my simple data writer = the=20 >>request sent for the second request contains: >> > Query Data: timestamp=3D${stamp_g1} >> > >> > I expected it to replace the ${stamp_g1} with the value of the = regexp... >> > >> > Any points would be appreciated. >> > >> > Thanks, >> > Bob >> > >> >> >>--=20 >>Mike Lindsey >>"Ya know I vass normal once. I came to work vith a tie and a suit and >>sometimes panfs." >> >> >>--------------------------------------------------------------------- >>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 >=20 >=20 >=20 --------------------------------------------------------------------- To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: jmeter-user-help@jakarta.apache.org --=_045AF9CC.38592B30--