Return-Path: Delivered-To: apmail-jakarta-jmeter-user-archive@www.apache.org Received: (qmail 64017 invoked from network); 23 Nov 2009 17:52:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 23 Nov 2009 17:52:29 -0000 Received: (qmail 87777 invoked by uid 500); 23 Nov 2009 17:52:28 -0000 Delivered-To: apmail-jakarta-jmeter-user-archive@jakarta.apache.org Received: (qmail 87733 invoked by uid 500); 23 Nov 2009 17:52:28 -0000 Mailing-List: contact jmeter-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: 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 87723 invoked by uid 99); 23 Nov 2009 17:52:28 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 17:52:28 +0000 X-ASF-Spam-Status: No, hits=-2.6 required=5.0 tests=AWL,BAYES_00,HTML_MESSAGE X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of shettyd@gmail.com designates 209.85.222.196 as permitted sender) Received: from [209.85.222.196] (HELO mail-pz0-f196.google.com) (209.85.222.196) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Nov 2009 17:52:25 +0000 Received: by pzk34 with SMTP id 34so4176680pzk.11 for ; Mon, 23 Nov 2009 09:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type; bh=7ZxIUfg8x/Mg6XraUStnfQx/hwfGZRTQ/SGphsJzBmg=; b=EdKi1xWhIp67jpnidaB9sknVS3Nv4vLKn3+FUMVws9j31yyeAgh3bMpjtiaj73U5hp JW77uYPxn4AaNOeCXOAdP3E1nso8ccfq10N4SCAcVFwvPaDCBBbwTUeqimCViAyzjTMh IRbZ04ae5vqy/5/31tvG2egNOPYVYcGM84IpU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=lLhb82kezsKXn+8NjSQSrlE5a/XFd0el65FN71IniEcD63O4CAube88E50SKv+usFi +E+d+o4eVu8lmPYYDieON6ljv5d9wV3S4d37sGFS3YrKwPNlFJsnLAxKzBp/vms0VOZw Hv8JM2v8IX3exW4Yeb5J/N1VvFoNkK8Y0EcYk= MIME-Version: 1.0 Received: by 10.140.134.14 with SMTP id h14mr323853rvd.297.1258998722841; Mon, 23 Nov 2009 09:52:02 -0800 (PST) In-Reply-To: <26482688.post@talk.nabble.com> References: <26475373.post@talk.nabble.com> <26482688.post@talk.nabble.com> Date: Mon, 23 Nov 2009 09:52:02 -0800 Message-ID: <4483c26c0911230952g15c9c227ref17f18faf865c72@mail.gmail.com> Subject: Re: problem in reading variable set by capturing groups in regex with "Match No." set to negative From: Deepak Shetty To: JMeter Users List Content-Type: multipart/alternative; boundary=000e0cd1728ca5ce4404790d7b33 --000e0cd1728ca5ce4404790d7b33 Content-Type: text/plain; charset=ISO-8859-1 Hi For Each (inputVar = tgDataColumn , returnVar = anything, ignored) +Counter (Add this config element, start=1,increment=1,maximum=${tgDataColumn_matchNr}, referenceName=C) use ${__javaScript(vars.get("tgDataColumn_" + vars.get("C") + "_g1"))} to get the 1st group. If you want to iterate over all groups (though i think you just want the 8th group/9th group) use ForEach with inputVar=refName_${C}_g regards deepak On Mon, Nov 23, 2009 at 9:39 AM, rosiere wrote: > > Hello, > > In fact my superior just spent lot of time on regex and did not want to > give > it up. > > As for XPath, I also tried it and met problems like " Server returned HTTP > response code: 503 for URL: http://www.w3.org/TR/html4/loose.dtd". > > I found an article that told me that the bug was fixed but not released in > the latest version. So should I use the nightly build after 789187? > > > http://mail-archives.apache.org/mod_mbox/jakarta-jmeter-user/200909.mbox/%3C25aac9fc0909040922j55a1f563t2e29b27eed189731@mail.gmail.com%3E > > > > rosiere wrote: > > > > Hello, > > > > I want to parse an html 's content, and create an HTTP request on > > each of its elements. The Http request will use some . > > > > (I did not use XPath because I'm not sure if the initial html
element's > > content as its parameter, according to predefined rules. So I used a > regex > > to capture a 's content as a group, on these
and > > the page that contains it are well-formed.) > > > > This is my regular expression (say that I have only two cells in each > > wanted tr. The cell's class must be "tgDataColumn", and I want to > capture > > their content): > > > > \n\n > > > > > > > > I will use it to capture all occurrences (all that contains > > "class=tgDataColumn" or "class="tgDataColumn"") in a HTML, then, in a > > foreach controller whose "Input variable prefix" is set to "myRef" (the > > "Reference Name" of my regex extrazctor), I want to reference to > variables > > created by regex, with: > > "myRef_n_gm" syntax. I created a Http sampler, that uses each group > > ${myRef_n_gm}'s value as a parameter. > > > > However under my foreach controller, I'm unable to find these myRef_n_gm > > variables' value, and at last they are represented like literals: > > "${myRef_n_g0}", "${myRef_n_g1}", etc... > > > > The only thing I can do is capture the td's content and write it into a > > template of regex extractor - A=$1$&B=$2$, then use the concatenated > > template value (like "A=xx&B=yy") as a whole, in my foreach controller. > > > > > > What did I miss? > > > > > > > > -- > View this message in context: > http://old.nabble.com/problem-in-reading-variable-set-by-capturing-groups-in-regex-with-%22Match-No.%22-set-to-negative-tp26475373p26482688.html > Sent from the JMeter - User mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org > > --000e0cd1728ca5ce4404790d7b33--
> > class=(?:\"tgDataColumn\"|tgDataColumn)(?:.*index=[\d+]\'\">)(.*) > class=(?:\"tgDataColumn\"|tgDataColumn)(?:.*index=[\d+]\'\">)(.*)