> From: BAZLEY, Sebastian 
...
> It might be useful to be able to specify that a string is to be
treated
> literally, not as a regular expression This might save a bit of hassle
> sometimes.
> 
> Perhaps add another checkbox - or two, allowing for case-blind
compares.
> These would mean that the Assertion was to use ordinary Java string
> compares.
> 
Good idea Seb. It would be even more useful to allow response assertions
to combine a plain text template with placeholders for
macro-replacement-style regular expressions. 

So the template could be:
----------------------------------
<HTML>
<BODY bgcolor="#FFFFFF">
        Today's Date is: MY-DATE
        Today's Day is: MY-DAY
        Today's phase of wisdom is: MY-WISDOM-PHRASE
</BODY>
</HTML>
----------------------------------

At runtime, the placeholders would be replaced by separately assigned
regular expressions:
----------------------------------
MY-DATE = /nn\-nn\-nnnn/  
MY-DAY = /day regex/  
MY-WISDOM-PHRASE = /phrase regex/
----------------------------------

This way, it would be easy to build and maintain tests where we know
only certain sections of the response page are variable. 

With regards,
Sonam Chauhan
-- 
Corporate Express Australia Ltd.
Phone: +61-2-9335-0725, Fax: 9335-0753, Email: [EMAIL PROTECTED]
 

> -----Original Message-----
> From: BAZLEY, Sebastian [mailto:[EMAIL PROTECTED]
> Sent: Thursday, 11 December 2003 2:43 AM
> To: 'JMeter Users List'
> Subject: RE: Hassles generating text assertions
> 
> In your example, the only meta characters that need escaping are the
> square
> brackets, which are used to introduce character classes.
> 
> Quotes are not special.
> 
> ==
> 
> It might be useful to be able to specify that a string is to be
treated
> literally, not as a regular expression This might save a bit of hassle
> sometimes.
> 
> Perhaps add another checkbox - or two, allowing for case-blind
compares.
> These would mean that the Assertion was to use ordinary Java string
> compares.
> 
> S.
> -----Original Message-----
> From: Jordi Salvat i Alabart [mailto:[EMAIL PROTECTED]
> Sent: 10 December 2003 15:19
> To: JMeter Users List
> Subject: Re: Hassles generating text assertions
> 
> 
> Hi Sonam,
> 
> I've been testing. The Response Assertion seems to be handling escaped
> spaces, quotes, brackets, etc. nicely. In any case, if it doesn't,
it's
> a bug, since the org.apache.oro.text.regex package description says:
> "Any other backslashed character matches itself." Which means that
> quotemeta is perfectly appropriate for your purpose (although it tends
> to escape too much: it essentially escapes all non-alphanumeric
> characters).
> 
> Please double-check your tests.
> 
> --
> Salut,
> 
> Jordi.
> 
> 
> En/na Sonam Chauhan ha escrit:
> > Hi -
> >
> > I have run into problems getting JMeter to do text assertions on
certain
> > HTML text.
> >
> > I want JMeter response assertions to ensures HTML snippets like the
one
> > below occur in the HTTP response:
> > --------------------------------------------------------
> > <input type="hidden" name="NEW_ITEM-DESCRIPTION[1]" value = "Leader
ohp
> > trolley">
> > --------------------------------------------------------
> >
> > This requires that things like the quotation mark ('"'), be escaped.
> JMeter
> > uses Jakarta-ORO which implements Perl-compatible regular
expressions
> (doco:
> > http://jakarta.apache.org/oro/index.html). So I figured  using Perl
> > quotemeta could escape the text properly:
> > --------------------------------------------------------
> > bash$ perl -le 'print quotemeta q/<input type="hidden"
> > name="NEW_ITEM-DESCRIPTION[1]" value = "Leader ohp trolley">/'
> > --------------------------------------------------------
> >
> > That gave me:
> > --------------------------------------------------------
> > \<input\ type\=\"hidden\"\ name\=\"NEW_ITEM\-DESCRIPTION\[1\]\"\
value\
> \=\
> > \"Leader\ ohp\ trolley\"\>
> > --------------------------------------------------------
> >
> > This worked to an extent. The problem is that Jakarta-ORO/JMeter
does
> not
> > like certain things Perl quotemeta does -- like the escaping of
spaces
> ('\
> > '), or escaping square brackets ('\[1\]').
> >
> > Can anyone let me know a good way to escape the HTML snippets above
so
> that
> > JMeter can use it in a response assertions?
> >
> > With regards,
> > Sonam Chauhan
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to