You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Dave Maung <dm...@yahoo.com> on 2005/02/27 11:34:27 UTC

dealing with blank line on response assertion

Hi everybody, 
I am very new to JMeter and I am trying out JMeter for a week now and I am loving it. I have a question about response assertion. My assertion always failed when I have blankline on response data returns.
For example:
My Response  data returns
<root name="Hello">
 
 
 
</root>
 
 
 
 
I am doing the response assertion with Text Response selected and contain is slected on pattern matching rule. 
 
 
"My pattern to Test" value is 
 
<root name="Hello">.*</root>
 
How do I ignore the blank line?. 
 
Thanks for the help
Dave
 

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: dealing with blank line on response assertion

Posted by sebb <se...@gmail.com>.
On Sun, 27 Feb 2005 02:34:27 -0800 (PST), Dave Maung <dm...@yahoo.com> wrote:
> Hi everybody,
> I am very new to JMeter and I am trying out JMeter for a week now and I am loving it. I have a question about response assertion. My assertion always failed when I have blankline on response data returns.
> For example:
> My Response  data returns
> <root name="Hello">
> 
> </root>
> 
> I am doing the response assertion with Text Response selected and contain is slected on pattern matching rule.
> 
> "My pattern to Test" value is
> 
> <root name="Hello">.*</root>
> 
> How do I ignore the blank line?.
> 

By default, "." does not match newlines, so your regex does not match
the example. See:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#Response_Assertion

To match newlines as well, you can either set single line mode:

(?s)<root name="Hello">.*</root>

or you could explicitly match newline:

<root name="Hello">[.\n]*</root>

> Thanks for the help
> Dave
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>

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