You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by "akshata s.m." <ak...@yahoo.com> on 2008/11/14 14:52:15 UTC

Regexp extrator in my test plan

Hello,

I am trying to fetch an Id using regexp extractor.
The sampler in which i am intending to replace the Id with my reference variable is the first sampler in my test plan.

So where should i add the regexp extractor?

1. Is it just before my first sampler?
2. Should i add it to the testplan along with the configuration elements globally?

Currently i m placing it just before the first sampler and it picks the default value entered in the regexp extractor. 

<INPUT TYPE="hidden" NAME="modId" VALUE="5">
The above javascript occurs atleast thrice in my code. And i want to pick the first occurence. My regexp extractor definition looks like this:

Regexp Extractor:

Reference name:  modid
Regular exp:     <INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(\d+)">
Template:   $1$
Match No:  1
Default val:  Failed to fetch modid

Kindly let me know if my regexp, template and match number is fine. The regexp i have used is verified using the ORO demo applet.

Regards,
Akshata



      

Re: Regexp extrator in my test plan

Posted by Ronan Klyne <ro...@groupbc.com>.
akshata s.m. wrote:
> Hello,
> 
> I am trying to fetch an Id using regexp extractor.
> The sampler in which i am intending to replace the Id with my reference variable is the first sampler in my test plan.
> 
> So where should i add the regexp extractor?
> 
> 1. Is it just before my first sampler?
> 2. Should i add it to the testplan along with the configuration elements globally?

It should be a child of your sampler. This will ensure that it only
applies to this sampler.

> 
> Currently i m placing it just before the first sampler and it picks the default value entered in the regexp extractor. 
> 
> <INPUT TYPE="hidden" NAME="modId" VALUE="5">
> The above javascript occurs atleast thrice in my code. And i want to pick the first occurence. My regexp extractor definition looks like this:
> 
> Regexp Extractor:
> 
> Reference name:  modid
> Regular exp:     <INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(\d+)">
> Template:   $1$
> Match No:  1
> Default val:  Failed to fetch modid
> 
> Kindly let me know if my regexp, template and match number is fine. The regexp i have used is verified using the ORO demo applet.

They all look good to me...


	Ronan

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regexp extrator in my test plan

Posted by sebb <se...@gmail.com>.
On 14/11/2008, Tushar Joshi <tu...@gmail.com> wrote:
> Please try this:
>  <INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(.+?)">

The previous RE was better if VALUE can only be digits.

If not, then it's cheaper to use:  VALUE="[^"]+"  as that does not
require back-tracking.

>  with regards
>  Tushar
>
>
>  Tushar Joshi
>  http://www.tusharvjoshi.com
>
>
>
>  On Fri, Nov 14, 2008 at 8:52 AM, akshata s.m. <ak...@yahoo.com> wrote:
>
>  > Hello,
>  >
>  > I am trying to fetch an Id using regexp extractor.
>  > The sampler in which i am intending to replace the Id with my reference
>  > variable is the first sampler in my test plan.
>  >
>  > So where should i add the regexp extractor?
>  >
>  > 1. Is it just before my first sampler?
>  > 2. Should i add it to the testplan along with the configuration elements
>  > globally?
>  >
>  > Currently i m placing it just before the first sampler and it picks the
>  > default value entered in the regexp extractor.
>  >
>  > <INPUT TYPE="hidden" NAME="modId" VALUE="5">
>  > The above javascript occurs atleast thrice in my code. And i want to pick
>  > the first occurence. My regexp extractor definition looks like this:
>  >
>  > Regexp Extractor:
>  >
>  > Reference name:  modid
>  > Regular exp:     <INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(\d+)">
>  > Template:   $1$
>  > Match No:  1
>  > Default val:  Failed to fetch modid
>  >
>  > Kindly let me know if my regexp, template and match number is fine. The
>  > regexp i have used is verified using the ORO demo applet.
>  >
>  > Regards,
>  > Akshata
>  >
>  >
>  >
>  >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: Regexp extrator in my test plan

Posted by Tushar Joshi <tu...@gmail.com>.
Please try this:
<INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(.+?)">

with regards
Tushar

Tushar Joshi
http://www.tusharvjoshi.com


On Fri, Nov 14, 2008 at 8:52 AM, akshata s.m. <ak...@yahoo.com> wrote:

> Hello,
>
> I am trying to fetch an Id using regexp extractor.
> The sampler in which i am intending to replace the Id with my reference
> variable is the first sampler in my test plan.
>
> So where should i add the regexp extractor?
>
> 1. Is it just before my first sampler?
> 2. Should i add it to the testplan along with the configuration elements
> globally?
>
> Currently i m placing it just before the first sampler and it picks the
> default value entered in the regexp extractor.
>
> <INPUT TYPE="hidden" NAME="modId" VALUE="5">
> The above javascript occurs atleast thrice in my code. And i want to pick
> the first occurence. My regexp extractor definition looks like this:
>
> Regexp Extractor:
>
> Reference name:  modid
> Regular exp:     <INPUT\s+TYPE="hidden"\s+NAME="modId"\s+VALUE="(\d+)">
> Template:   $1$
> Match No:  1
> Default val:  Failed to fetch modid
>
> Kindly let me know if my regexp, template and match number is fine. The
> regexp i have used is verified using the ORO demo applet.
>
> Regards,
> Akshata
>
>
>
>