Many thanks for your prompt and informative reply. It is now working
correctly with a response assertion as you suggested.

Ruth

On Mon, Feb 13, 2012 at 6:06 PM, sebb <[email protected]> wrote:

> On 13 February 2012 16:57, ruthm <[email protected]> wrote:
> > Hello,
> >
> > I've got the following setup in JMeter:
> >
> > --ThreadGroup
> >    -- Simple Controller
> >         -- User Defined Variable (defines a variable responseFail with
> > value true)
> >         -- While controller (with condition ${responseFail} - meaning
> > repeat look while responseFail == true)
> >             -- HTTP Request
> >                 -- Post Processor - Regex extractor
> >
> > The behavior I would like is for the HTTP request response to be
> analysed.
> > If a page displaying the message " ..... unhandled exception
> encountered" is
> > returned then I want the request to be attempted until it succeeds. To be
> > exact the page returned would include the following text:
> >
> > <html>
> > <head>
> > <title>E-commerce system - unhandled exception encountered</title>
> > <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
> > ....
> >
> > The way I've implemented this is by setting up the following in the Regex
> > extractor settings:
> > ReferenceName: responseFail
> > Regular Expression: unhandled exception (.+?)</title> =~m/encountered/
>
> That is not correct. Just use
>
> <title>E-commerce system - unhandled exception encountered</title>
>
> > Template:$1$
> > MatchNo:0
> >
> > The behavior I am trying to achieve is that, if the page body contains
> the
> > message 'unhandled exception encountered' then this will match the RegExp
> > and return true in $1. If the response is succesful then a page not
> > containing the msg is returned and $1 will be false thus having the
> variable
> > $responseFail set to false, breaking out of the while loop.
> > Instead for now JMeter remains stuck in while loop - therefore i must
> have
> > something wrong in the way i defined my regular expression.
> >
> > Does anyone have any suggestions on how i can fix this?
>
> Since you are not really interested in the content of the response,
> just whether or not it contains some specific test, why not use a
> response assertion?
>
> This will set the JMeterThread.last_sample_ok variable.
>
> > THanks in advance,
> > Ruth
> >
> >
> > --
> > View this message in context:
> http://jmeter.512774.n5.nabble.com/Some-help-with-Regex-please-tp5479839p5479839.html
> > Sent from the JMeter - User mailing list archive at Nabble.com.
> >
> > ---------------------------------------------------------------------
> > 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