You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Raffaele Viola <ra...@gmail.com> on 2006/01/12 17:43:34 UTC

use of Regular Expression Extractor

Hi all,

This is a response that the server send to me.
In the message's body there are these lines:

<method>
<name>list<\name>
<object>webuser<\object>
<attribute><name>returnValue<\name><value>0<\value><\attribute>
<attribute><name>returnComment<\name><value><\value><\attribute>
<attribute><name>nbstart<\name><value>0<\value><\attribute>
<\method>

I need to know the value of the attribute returnValue and nbstart contained
between the tags <value> and <\value>.
What can I write in Regular Expression Extractor to take the value and put
it in a variable?

Thanks a lot!!!
-Raffo

Fwd: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
Sorry I forgot the "/"

This is a response that the server send to me.
In the message's body there are these lines:

<method><name>list</name><object>webuser</object><attribute><name>returnValue</name><value>
0</value></attribute><attribute><name>returnComment</name><value></value></attribute>
<attribute><name>nbstart</name><value>0</value></attribute> </method>

This is a unique string without any space and

I must get a value contents between tha tag <value>.... and ... </value>

I try to use a regular expression like :
<name>returnValue</name><value>(\d+)</value>
but it doesn't match with the wordn that I want.

What can i do?

-Raffo

Re: use of Regular Expression Extractor

Posted by Noam Paz <no...@db.com>.
as I wrote you already,
<name>returnValue<name>

can never be matched with
<name>returnValue</name>


Best regards / Viele Grüße

Noam Paz




                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
             Raffaele Viola <ra...@gmail.com>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
             16.01.2006 17:43                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              To 
                                                                                                                                                                                                                                                                                                                                                                                                                       JMeter Users List <jm...@jakarta.apache.org>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           cc 
                                                                                                                                                                                                     Please respond to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                   "JMeter Users List" <jm...@jakarta.apache.org>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Subject 
                                                                                                                                                                                                                                                                                                                                                                                                                       Re: use of Regular Expression Extractor                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              




Sorry if I'm not clear!

This is a response that the server send to me.
In the message's body there are these lines:

<method><name>list</name><object>webuser</object><attribute><name>returnValue<name><value>
0</value></attribute><attribute><name>returnComment</name><value></value></attribute>
<attribute><name>nbstart</name><value>0</value></attribute> </method>

This is a unique string without any space and

I must get a value contents between tha tag <value>.... and ... </value>

I try to use a regular expression like :
<name>returnValue</name><value>(\d+)</value>
but it doesn't match with the wordn that I want.

What can i do?

-Raffo



--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



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


Re: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
Sorry if I'm not clear!

This is a response that the server send to me.
In the message's body there are these lines:

<method><name>list</name><object>webuser</object><attribute><name>returnValue<name><value>
0</value></attribute><attribute><name>returnComment</name><value></value></attribute>
<attribute><name>nbstart</name><value>0</value></attribute> </method>

This is a unique string without any space and

I must get a value contents between tha tag <value>.... and ... </value>

I try to use a regular expression like :
<name>returnValue</name><value>(\d+)</value>
but it doesn't match with the wordn that I want.

What can i do?

-Raffo

Re: use of Regular Expression Extractor

Posted by Noam Paz <no...@db.com>.
Raffo,
you write the response is
> > <attribute><name>returnValue<name><value>0</value></attribute>

But your regexp is
> > Can I use a regular expression like:
> >
> > Regex: <name>returnValue</name><value>(\d+)</value>
> >
with a "/" before "name".
Try to ommit it.

Best regards / Viele Grüße

Noam Paz

Deutsche Bank AG
GTO CIO PCB IT/O
Sales & Advisory IT
Brokerage & Advisory
Financial Planning

Alfred Herrhausen Allee 10a
D-65760 Eschborn

Tel: +49-69-910-69308
Fax: +49-69-910-68425
Mailto:noam.paz@db.com
http://is.ds.gt.pcam.intranet.db.com



                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
             Raffaele Viola <ra...@gmail.com>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
             16.01.2006 17:21                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              To 
                                                                                                                                                                                                                                                                                                                                                                                                                       JMeter Users List <jm...@jakarta.apache.org>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           cc 
                                                                                                                                                                                                     Please respond to                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        
                                                                                                                                                                                   "JMeter Users List" <jm...@jakarta.apache.org>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Subject 
                                                                                                                                                                                                                                                                                                                                                                                                                       Re: use of Regular Expression Extractor                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              




:-D OK!!!

I make a mistake!!!
I'm trying to use these Regex to get my variable but it seems  don't
work!!!!
I believe  that is because the Http response is without any space.
What can I do?

Sorry for my English but I'm a Italian Student!!!

Thanks a lot!!!!!!
_raffo

2006/1/16, sebb <se...@gmail.com>:
>
> On 16/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> > Hi all,
> >
> > This is a response that the server send to me.
> > In the message's body there are these lines:
> >
> > <method><name>list</name><object>webuser</object>
> > <attribute><name>returnValue<name><value>0</value></attribute>
> > <attribute><name>returnComment</name><value></value></attribute>
> > <attribute><name>nbstart</name><value>0</value></attribute></method>
> >
> > I need to know the value of the attribute returnValue and nbstart
> contained
> > between the tags <value> and </value>
> >
> > Can I use a regular expression like:
> >
> > Regex: <name>returnValue</name><value>(\d+)</value>
> >
>
> Try it and see.
>
> > Thanks a lot!!!
> > -Raffo
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>



--

Diese E-Mail enthaelt vertrauliche und/oder rechtlich geschuetzte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtuemlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.



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


Re: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
:-D OK!!!

I make a mistake!!!
I'm trying to use these Regex to get my variable but it seems  don't
work!!!!
I believe  that is because the Http response is without any space.
What can I do?

Sorry for my English but I'm a Italian Student!!!

Thanks a lot!!!!!!
_raffo

2006/1/16, sebb <se...@gmail.com>:
>
> On 16/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> > Hi all,
> >
> > This is a response that the server send to me.
> > In the message's body there are these lines:
> >
> > <method><name>list</name><object>webuser</object>
> > <attribute><name>returnValue<name><value>0</value></attribute>
> > <attribute><name>returnComment</name><value></value></attribute>
> > <attribute><name>nbstart</name><value>0</value></attribute></method>
> >
> > I need to know the value of the attribute returnValue and nbstart
> contained
> > between the tags <value> and </value>
> >
> > Can I use a regular expression like:
> >
> > Regex: <name>returnValue</name><value>(\d+)</value>
> >
>
> Try it and see.
>
> > Thanks a lot!!!
> > -Raffo
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: use of Regular Expression Extractor

Posted by sebb <se...@gmail.com>.
On 16/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> Hi all,
>
> This is a response that the server send to me.
> In the message's body there are these lines:
>
> <method><name>list</name><object>webuser</object>
> <attribute><name>returnValue<name><value>0</value></attribute>
> <attribute><name>returnComment</name><value></value></attribute>
> <attribute><name>nbstart</name><value>0</value></attribute></method>
>
> I need to know the value of the attribute returnValue and nbstart contained
> between the tags <value> and </value>
>
> Can I use a regular expression like:
>
> Regex: <name>returnValue</name><value>(\d+)</value>
>

Try it and see.

> Thanks a lot!!!
> -Raffo
>
>

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


Fwd: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
Hi all,

This is a response that the server send to me.
In the message's body there are these lines:

<method><name>list</name><object>webuser</object>
<attribute><name>returnValue<name><value>0</value></attribute>
<attribute><name>returnComment</name><value></value></attribute>
<attribute><name>nbstart</name><value>0</value></attribute></method>

I need to know the value of the attribute returnValue and nbstart contained
between the tags <value> and </value>

Can I use a regular expression like:

Regex: <name>returnValue</name><value>(\d+)</value>

Thanks a lot!!!
-Raffo

Re: use of Regular Expression Extractor

Posted by sebb <se...@gmail.com>.
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Java_Request

ClassName JavaTest

On 13/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> Excuse me but I don't understand what kind of sampler I have to use!
>
> -Raffo
>
>

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


Re: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
Excuse me but I don't understand what kind of sampler I have to use!

-Raffo

Re: use of Regular Expression Extractor

Posted by sebb <se...@gmail.com>.
Add a Java Sampler / Java Test and use ${VARIABLE} in one of the fields.
S.

On 13/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> Sorry   ... "/" instead of "\" of course.
>
> What can I do to display or write in a text file the variable?
>
> Thanks a lot!!!!
> -Raffo
>
>
> 2006/1/12, sebb <se...@gmail.com>:
> >
> > On 12/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> > > Hi all,
> > >
> > > This is a response that the server send to me.
> > > In the message's body there are these lines:
> > >
> > > <method>
> > > <name>list<\name>
> > > <object>webuser<\object>
> > > <attribute><name>returnValue<\name><value>0<\value><\attribute>
> > > <attribute><name>returnComment<\name><value><\value><\attribute>
> > > <attribute><name>nbstart<\name><value>0<\value><\attribute>
> > > <\method>
> > >
> > > I need to know the value of the attribute returnValue and nbstart
> > contained
> > > between the tags <value> and <\value>.
> >
> > Are you sure it is        <\value> ?
> > I would have expected </value>.
> >
> > > What can I write in Regular Expression Extractor to take the value and
> > put
> > > it in a variable?
> >
> > Assuming that it _is_ valid XML:
> >
> > Name: returnValue
> > Regex: <name>returnValue</name><value>(\d+)</value>
> > Template: $1$
> >
> > Similarly for nbstart - you'll need a second extractor to do this.
> >
> > ---------------------------------------------------------------------
> > 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


Re: use of Regular Expression Extractor

Posted by Raffaele Viola <ra...@gmail.com>.
Sorry   ... "/" instead of "\" of course.

What can I do to display or write in a text file the variable?

Thanks a lot!!!!
-Raffo


2006/1/12, sebb <se...@gmail.com>:
>
> On 12/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> > Hi all,
> >
> > This is a response that the server send to me.
> > In the message's body there are these lines:
> >
> > <method>
> > <name>list<\name>
> > <object>webuser<\object>
> > <attribute><name>returnValue<\name><value>0<\value><\attribute>
> > <attribute><name>returnComment<\name><value><\value><\attribute>
> > <attribute><name>nbstart<\name><value>0<\value><\attribute>
> > <\method>
> >
> > I need to know the value of the attribute returnValue and nbstart
> contained
> > between the tags <value> and <\value>.
>
> Are you sure it is        <\value> ?
> I would have expected </value>.
>
> > What can I write in Regular Expression Extractor to take the value and
> put
> > it in a variable?
>
> Assuming that it _is_ valid XML:
>
> Name: returnValue
> Regex: <name>returnValue</name><value>(\d+)</value>
> Template: $1$
>
> Similarly for nbstart - you'll need a second extractor to do this.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

Re: use of Regular Expression Extractor

Posted by sebb <se...@gmail.com>.
On 12/01/06, Raffaele Viola <ra...@gmail.com> wrote:
> Hi all,
>
> This is a response that the server send to me.
> In the message's body there are these lines:
>
> <method>
> <name>list<\name>
> <object>webuser<\object>
> <attribute><name>returnValue<\name><value>0<\value><\attribute>
> <attribute><name>returnComment<\name><value><\value><\attribute>
> <attribute><name>nbstart<\name><value>0<\value><\attribute>
> <\method>
>
> I need to know the value of the attribute returnValue and nbstart contained
> between the tags <value> and <\value>.

Are you sure it is        <\value> ?
I would have expected </value>.

> What can I write in Regular Expression Extractor to take the value and put
> it in a variable?

Assuming that it _is_ valid XML:

Name: returnValue
Regex: <name>returnValue</name><value>(\d+)</value>
Template: $1$

Similarly for nbstart - you'll need a second extractor to do this.

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