You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Michael Giroux <ml...@gmail.com> on 2008/05/08 23:53:02 UTC
How to specify single line qualifier (?s) with a response assertion pattern?
my current pattern is "some text.*heading +value" (without the quotes)
I wish the .* to match new-lines, so I have to specify the single line
modifier, but I'm not able to figure out how to do that exactly.
Thanks
Michael Giroux
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by Michael Giroux <ml...@gmail.com>.
The referenced doc indicates that the
> These can be used anywhere within the expression, e.g.
> (?i)apple(?-i) Pie - matches "ApPLe Pie", but not "ApPLe pIe"
If I place the (?s) at end of pattern I get the failure shown below.
Assertion failure message : Bad test configuration
org.apache.oro.text.MalformedCachePatternException: Invalid
expression:
TP-STORAGE CONTENTS:.*TX-TYPE +ECHOTPS(?s)
Unmatched parentheses.
I was able to place the (?s) at the start of the pattern and it did
match, so I'm in business for now, but thid does look like a bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by sebb <se...@gmail.com>.
http://perldoc.perl.org/perlre.html#Extended-Patterns
Explains how (?s) etc are used in Perl (not pearl)
On 09/05/2008, sebb <se...@gmail.com> wrote:
> Almost what you want:
>
> http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
>
>
>
> On 09/05/2008, Michael Giroux <ml...@gmail.com> wrote:
> > Thanks Steve, but the pearl docs dont help either.
> >
> > JMeter uses pearl style paterns without the / delimiters, so it is not
> > possible to specify
> >
> > /my pattern/s
> >
> > The JMeter docs say to use (?s) but do not show where it goes in the
> > pattern. For pearl, the modifier goes at the end of the pattern, but
> > JMeter does not use the / delimiters, so it is not obvious from the
> > JMeter docs where the modifier goes.
> >
> > I have tried:
> > first part.*(?s)second part
> > first part(.*?s)second part
> > first part(.?s)second part
> >
> > and a few others that I did not keep track of. These seem to parse,
> > but the match fails.
> >
> > I tried
> > first part.*second part(?s)
> >
> > and this fails with a parse exception for unmatched parens
> >
> > and
> > first part.*second part(?s):
> > seems to parse but does not match
> >
> >
> > An example of a valid pattern that specifies single line mode would
> > really be useful.
> >
> >
> > Michael
> >
> >
> > On Fri, May 9, 2008 at 8:05 AM, Steve Kapinos
> > <St...@tandberg.com> wrote:
> > > This might help...
> > >
> > > http://www.regular-expressions.info/dot.html
> > >
> > > Jmeter uses perl5 type regex I believe.. This guide talks about single
> > > line mode and the differences in what matches what, etc.
> > >
> > > -Steve
> > >
> > > -----Original Message-----
> > > From: Michael Giroux [mailto:mlgiroux@gmail.com]
> > > Sent: Friday, May 09, 2008 8:51 AM
> > > To: JMeter Users List
> > > Subject: Re: How to specify single line qualifier (?s) with a response
> > > assertion pattern?
> > >
> > > In fact, I posted my question *after* reading the user manual and trying
> > > to put the specifier in my pattern without success. The document could
> > > use an example.
> > >
> > > My pattern is
> > > some text.*some more text
> > >
> > > This fails because .* does not match new lines.
> > >
> > > I tried
> > > some text.*(?s)some more text
> > >
> > > This fails aparently because the single line specifier is in the wrong
> > > place.
> > >
> > > Can you give an example of how to adjust my pattern to include this
> > > specifier?
> > >
> > > THanks
> > > Michael
> > >
> > > On Thu, May 8, 2008 at 3:31 PM, sebb <se...@gmail.com> wrote:
> > >> http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#l
> > >> ine_mode
> > >>
> > >> On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
> > >>> my current pattern is "some text.*heading +value" (without the
> > >>> quotes)
> > >>>
> > >>> I wish the .* to match new-lines, so I have to specify the single
> > >>> line modifier, but I'm not able to figure out how to do that
> > > exactly.
> > >>>
> > >>> Thanks
> > >>> Michael Giroux
> > >>>
> > >>>
> > >>> ---------------------------------------------------------------------
> > >>> 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
> > >>
> > >>
> > >
> > > ---------------------------------------------------------------------
> > > 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
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > 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: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by sebb <se...@gmail.com>.
Almost what you want:
http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion
On 09/05/2008, Michael Giroux <ml...@gmail.com> wrote:
> Thanks Steve, but the pearl docs dont help either.
>
> JMeter uses pearl style paterns without the / delimiters, so it is not
> possible to specify
>
> /my pattern/s
>
> The JMeter docs say to use (?s) but do not show where it goes in the
> pattern. For pearl, the modifier goes at the end of the pattern, but
> JMeter does not use the / delimiters, so it is not obvious from the
> JMeter docs where the modifier goes.
>
> I have tried:
> first part.*(?s)second part
> first part(.*?s)second part
> first part(.?s)second part
>
> and a few others that I did not keep track of. These seem to parse,
> but the match fails.
>
> I tried
> first part.*second part(?s)
>
> and this fails with a parse exception for unmatched parens
>
> and
> first part.*second part(?s):
> seems to parse but does not match
>
>
> An example of a valid pattern that specifies single line mode would
> really be useful.
>
>
> Michael
>
>
> On Fri, May 9, 2008 at 8:05 AM, Steve Kapinos
> <St...@tandberg.com> wrote:
> > This might help...
> >
> > http://www.regular-expressions.info/dot.html
> >
> > Jmeter uses perl5 type regex I believe.. This guide talks about single
> > line mode and the differences in what matches what, etc.
> >
> > -Steve
> >
> > -----Original Message-----
> > From: Michael Giroux [mailto:mlgiroux@gmail.com]
> > Sent: Friday, May 09, 2008 8:51 AM
> > To: JMeter Users List
> > Subject: Re: How to specify single line qualifier (?s) with a response
> > assertion pattern?
> >
> > In fact, I posted my question *after* reading the user manual and trying
> > to put the specifier in my pattern without success. The document could
> > use an example.
> >
> > My pattern is
> > some text.*some more text
> >
> > This fails because .* does not match new lines.
> >
> > I tried
> > some text.*(?s)some more text
> >
> > This fails aparently because the single line specifier is in the wrong
> > place.
> >
> > Can you give an example of how to adjust my pattern to include this
> > specifier?
> >
> > THanks
> > Michael
> >
> > On Thu, May 8, 2008 at 3:31 PM, sebb <se...@gmail.com> wrote:
> >> http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#l
> >> ine_mode
> >>
> >> On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
> >>> my current pattern is "some text.*heading +value" (without the
> >>> quotes)
> >>>
> >>> I wish the .* to match new-lines, so I have to specify the single
> >>> line modifier, but I'm not able to figure out how to do that
> > exactly.
> >>>
> >>> Thanks
> >>> Michael Giroux
> >>>
> >>>
> >>> ---------------------------------------------------------------------
> >>> 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
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > 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
> >
> >
>
> ---------------------------------------------------------------------
> 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: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by Michael Giroux <ml...@gmail.com>.
Thanks Steve, but the pearl docs dont help either.
JMeter uses pearl style paterns without the / delimiters, so it is not
possible to specify
/my pattern/s
The JMeter docs say to use (?s) but do not show where it goes in the
pattern. For pearl, the modifier goes at the end of the pattern, but
JMeter does not use the / delimiters, so it is not obvious from the
JMeter docs where the modifier goes.
I have tried:
first part.*(?s)second part
first part(.*?s)second part
first part(.?s)second part
and a few others that I did not keep track of. These seem to parse,
but the match fails.
I tried
first part.*second part(?s)
and this fails with a parse exception for unmatched parens
and
first part.*second part(?s):
seems to parse but does not match
An example of a valid pattern that specifies single line mode would
really be useful.
Michael
On Fri, May 9, 2008 at 8:05 AM, Steve Kapinos
<St...@tandberg.com> wrote:
> This might help...
>
> http://www.regular-expressions.info/dot.html
>
> Jmeter uses perl5 type regex I believe.. This guide talks about single
> line mode and the differences in what matches what, etc.
>
> -Steve
>
> -----Original Message-----
> From: Michael Giroux [mailto:mlgiroux@gmail.com]
> Sent: Friday, May 09, 2008 8:51 AM
> To: JMeter Users List
> Subject: Re: How to specify single line qualifier (?s) with a response
> assertion pattern?
>
> In fact, I posted my question *after* reading the user manual and trying
> to put the specifier in my pattern without success. The document could
> use an example.
>
> My pattern is
> some text.*some more text
>
> This fails because .* does not match new lines.
>
> I tried
> some text.*(?s)some more text
>
> This fails aparently because the single line specifier is in the wrong
> place.
>
> Can you give an example of how to adjust my pattern to include this
> specifier?
>
> THanks
> Michael
>
> On Thu, May 8, 2008 at 3:31 PM, sebb <se...@gmail.com> wrote:
>> http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#l
>> ine_mode
>>
>> On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
>>> my current pattern is "some text.*heading +value" (without the
>>> quotes)
>>>
>>> I wish the .* to match new-lines, so I have to specify the single
>>> line modifier, but I'm not able to figure out how to do that
> exactly.
>>>
>>> Thanks
>>> Michael Giroux
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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
>>
>>
>
> ---------------------------------------------------------------------
> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
RE: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by Steve Kapinos <St...@tandberg.com>.
This might help...
http://www.regular-expressions.info/dot.html
Jmeter uses perl5 type regex I believe.. This guide talks about single
line mode and the differences in what matches what, etc.
-Steve
-----Original Message-----
From: Michael Giroux [mailto:mlgiroux@gmail.com]
Sent: Friday, May 09, 2008 8:51 AM
To: JMeter Users List
Subject: Re: How to specify single line qualifier (?s) with a response
assertion pattern?
In fact, I posted my question *after* reading the user manual and trying
to put the specifier in my pattern without success. The document could
use an example.
My pattern is
some text.*some more text
This fails because .* does not match new lines.
I tried
some text.*(?s)some more text
This fails aparently because the single line specifier is in the wrong
place.
Can you give an example of how to adjust my pattern to include this
specifier?
THanks
Michael
On Thu, May 8, 2008 at 3:31 PM, sebb <se...@gmail.com> wrote:
> http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#l
> ine_mode
>
> On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
>> my current pattern is "some text.*heading +value" (without the
>> quotes)
>>
>> I wish the .* to match new-lines, so I have to specify the single
>> line modifier, but I'm not able to figure out how to do that
exactly.
>>
>> Thanks
>> Michael Giroux
>>
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
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: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by Michael Giroux <ml...@gmail.com>.
In fact, I posted my question *after* reading the user manual and
trying to put the specifier in my pattern without success. The
document could use an example.
My pattern is
some text.*some more text
This fails because .* does not match new lines.
I tried
some text.*(?s)some more text
This fails aparently because the single line specifier is in the wrong place.
Can you give an example of how to adjust my pattern to include this specifier?
THanks
Michael
On Thu, May 8, 2008 at 3:31 PM, sebb <se...@gmail.com> wrote:
> http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#line_mode
>
> On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
>> my current pattern is "some text.*heading +value" (without the quotes)
>>
>> I wish the .* to match new-lines, so I have to specify the single line
>> modifier, but I'm not able to figure out how to do that exactly.
>>
>> Thanks
>> Michael Giroux
>>
>> ---------------------------------------------------------------------
>> 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
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
Re: while condition doesn't work
Posted by sebb <se...@gmail.com>.
Looks basically OK.
Check the jmeter log file for errors.
On 09/05/2008, Fulvio Guglielmelli <fu...@yahoo.it> wrote:
> Hi
> i need to use while Condition verifing if var1<var2
>
> i tryed to use:
> ${__javaScript(${var1}<${var2})}
>
> i tryed to set a variable (superato ) in a BeanShell Assertion and test:
> while condition ${superato} or ${__P(superato,)}
>
> String totale = vars.get("totale");
> String lim= vars.get("limit");
>
> int limIntero = new Integer(lim).intValue();
> int totaleIntero = new Integer(totale).intValue();
> if (limIntero>totaleIntero)
> {
> print("SUPERATO");
> vars.put("superato","false");
> }
>
>
> but NOTHING
>
> Can any one help me?
>
>
> Fulvio
>
>
>
> ---------------------------------
> Scopri il Blog di Yahoo! Mail: trucchi, novità , consigli... e la tua opinione!
---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
while condition doesn't work
Posted by Fulvio Guglielmelli <fu...@yahoo.it>.
Hi
i need to use while Condition verifing if var1<var2
i tryed to use:
${__javaScript(${var1}<${var2})}
i tryed to set a variable (superato ) in a BeanShell Assertion and test:
while condition ${superato} or ${__P(superato,)}
String totale = vars.get("totale");
String lim= vars.get("limit");
int limIntero = new Integer(lim).intValue();
int totaleIntero = new Integer(totale).intValue();
if (limIntero>totaleIntero)
{
print("SUPERATO");
vars.put("superato","false");
}
but NOTHING
Can any one help me?
Fulvio
---------------------------------
Scopri il Blog di Yahoo! Mail: trucchi, novità , consigli... e la tua opinione!
Re: How to specify single line qualifier (?s) with a response assertion pattern?
Posted by sebb <se...@gmail.com>.
http://jakarta.apache.org/jmeter/usermanual/regular_expressions.html#line_mode
On 08/05/2008, Michael Giroux <ml...@gmail.com> wrote:
> my current pattern is "some text.*heading +value" (without the quotes)
>
> I wish the .* to match new-lines, so I have to specify the single line
> modifier, but I'm not able to figure out how to do that exactly.
>
> Thanks
> Michael Giroux
>
> ---------------------------------------------------------------------
> 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