You can use string bean keys in ok string.
> -----Original Message-----
> From: Eric COQUELIN [mailto:eric.coquelin@...]
> Sent: 17 June 2004 08:13
> To: Philip Aston
> Subject: Re: [Grinder-use] how to catch errors ?
> I know that G3 is much more adapted for what I want to do=20
> but in my case, I
> have to use G2.
> I know that the OK string is a solution but the string is=20
> static and in my
> tests, messages are variables and I have never the same=20
> error string... Is
> there another way ?
> ----- Original Message -----
> From: "Philip Aston" <paston@...>
> To: "Eric COQUELIN" <ecoqueli@...>;
> Sent: Wednesday, June 16, 2004 9:05 PM
> Subject: RE: [Grinder-use] how to catch errors ?
> > Eric COQUELIN writes on 16 June 2004 14:48:
> > >
> > > By default, the Grinder 2.8 generates errors when a page is
> > > unavailable on a server. I have developped a specific=20
> JAVA source
> > > to handle HTTP response and process HTML content. In some case I
> > > would like to notify an error when conditions are not met.
> > >
> > > For the moment, I use handleResponse() function but, I can only
> > > throw exception but it prints stacks on the standard output. Is
> > > there another function or another way to notify a clean error ?
> > This kind of thing is much easier and more transparent in G3.
> > As a work around for G2, you could add an OK string to=20
> your test which
> > contains a string bean key. Based on the success or failure of the
> > test, the string bean could return a value for the key=20
> whcih would be
> > either "" (which will be found in any non-null response body) or a
> > string that you know isn't in the response body (perhaps=20
> "ERORR - some
> > descriptive message).
> > - Phil
> Our name has changed. Please update your address book to=20
> the following format: "recipient@...".
> This message contains information that may be privileged or=20
> confidential and is the property of the Capgemini Group. It=20
> is intended only for the person to whom it is addressed. If=20
> you are not the intended recipient, you are not authorized=20
> to read, print, retain, copy, disseminate, distribute, or=20
> use this message or any part thereof. If you receive this =20
> message in error, please notify the sender immediately and=20
> delete all copies of this message.