jmeter-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak Shetty <shet...@gmail.com>
Subject Re: How can i extract from the same link matched two variables
Date Fri, 12 Aug 2011 22:40:01 GMT
>I'm matching with a Regex Post Processor an URL. In this URL there is an ID
and a NAME, i need to extract both values from the same URL matched.
Possible using regex groups
say your regex is like id=(someconditionthatmatchesid)
name=(someconditionthatmatchesname) => The round brackets are important here
In template say you have $1$~$2$ then the matching value will look like
id~name when you say ${variableName_index}

If you want just the ID you use ${variableName_INDEX_g1} and for name you
use ${variableName_INDEX_g2} where Index is the match number(Assuming you
have multiple results). if you just have a single result the
${variableName_g1} and ${variableName_g2}. g1 corresponds to the first
matching group which in the example above is the id.

regards
deepak


On Fri, Aug 12, 2011 at 2:03 PM, Hans C. Poo <hans@welinux.cl> wrote:

> Hi,
>
> I'm matching with a Regex Post Processor an URL. In this URL there is an ID
> and a NAME, i need to extract both values from the same URL matched.
>
> If i use two consecutive regexes post processors to do the capture, each
> one capture on a different url from the matched set, making the ID and name
> to be inconsistent.
>
> How can i extract from the same link matched two variables ?
>
> Thanks
> Hans
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message