3 messages in com.canoo.lists.webtestRe: [Webtest] Re: Resetting between t...
FromSent OnAttachments
Brian O'Kelley05 May 2003 12:35 
Jeff Nielsen07 May 2003 03:32 
Healey, Thomas08 May 2003 05:29 
Subject:Re: [Webtest] Re: Resetting between test runs
From:Jeff Nielsen (jeff@digitalfocus.com)
Date:05/07/2003 03:32:25 AM
List:com.canoo.lists.webtest

I altered WebTest so that it would set a property with the failure message when a test failed, but still continue on with the ant build. This was because I had tasks I *always* wanted to run after the tests--the "finally" behavior you allude to. Using this failure property, I can perform my cleanup tasks (other ant tasks) and then determine afterward whether a test has failed.

I added this code to com.canoo.webtest.ant.TestSpecificationTask.execute()

. String failure = PlainTextReporter.getBuildFailMessage(webTestResult); . if ((webTestResult.isError() || webTestResult.isFailure()) . && fConfig.getFailureProperty() != null) { . project.setProperty(fConfig.getFailureProperty(), failure); . }

and this code to com.canoo.webtest.engine.Configuration

. private String fFailureProperty; . public String getFailureProperty() { return fFailureProperty; } . public void setFailureProperty(String propertyName) { . fFailureProperty = propertyName; . }

----- Original Message ----- From: "Brian O'Kelley" <bri@poindextersystems.com> To: <webt@gate.canoo.com> Sent: Monday, May 05, 2003 3:36 PM Subject: [Webtest] Re: Resetting between test runs

In partial answer to my own question - here's what I did:

I created a new action on my web application (I'm using struts, so I probably should say Action) that does the database resetting that I need.

I call this before and after the critical tasks. This mitigates the need to call Java classes or access the database directly.

Now - how can I get catch/finally behavior from this?