[Webtest] Is there a "finally" functionality in WebTest?

Paul King Paul King <paulk@asert.com.au>
Sat, 06 Oct 2007 14:20:37 +1000


Marc Guillemot wrote:
> Hi,
> 
> there is (at least currently) no "finally" functionality in WebTest.
> 
> I see following solutions:
> - share the session informations to reuse them in different <webtest>.
> All tests would use the same server session which has advantages and
> drawbacks
> - register a build listeners that executes some call when it detects
> that the <steps> failed
> - write own step container that allows to specify a "finally" section.
> This is surely what allows to write the "nicest" scripts and provides
> the most information in the reports. This is probably only a few lines
> of Groovy code ;-)
> 
> Marc.

We have used the ant-contrib try/catch/finally task to achieve
something similar to what you are after. Alternatively, if you
have a configurable system, we have altered session timeouts
down to a few seconds on a test environment which might also
work for you.

Cheers, Paul.