[Webtest] Unconditionally executing some steps

Marc Guillemot webtest@lists.canoo.com
Thu, 05 Jan 2006 20:29:21 +0100


Hi,

I guess that it is possible to use a small groovy step to do this but
I'm not a groovy expert (Mittie, can you check it? ;-)):

<groovy description="change config">
  step.context.testSpecification.config.haltonerror = false
</groovy>

The bad side is that it is highly tied to the webtest API that may
change but even in this case this should be quite easy to adapt.

Perhaps an alternative in your case: to avoid having to delete the
created data before the next run, you can sometimes use the current
date/time in the "id" of the data that you save. For instance if a test
creates a new user with a login like "foo20060105-202612" then the next
test run may create a new user with a login like "foo20060105-203500"
and hasn't problem with data created by previous runs.

Marc.

Curelea, Alexandru wrote:
> Hi all,
> 
> First, to the developers, thank you for an excellent tool.
> 
> I'm running into the following difficulty using Webtest.  Each of my tests has a few clean-up steps at the end, which delete data that was created during the test.  If this data isn't removed, any tests that follow will most likely fail due to conflicts.  The data involves IDs generated at runtime, which I'm capturing, storing and using as dynamic properties.
> 
> My problem is that if any of the steps in the test fail, the cleanup steps don't get executed.  The "haltonerror" and "haltonfailure" config options don't seem to help, because on a failure the execution still stops during the current webtest.  I've tried putting the cleanup steps in a separate webtest and even in a separate target, but in these cases I can't seem to access the values of the dynamic properties (unless I'm doing something wrong?)
> 
> Does anyone know how I could get this to work?  It is the only problem I've had with Webtest so far, but unfortunately it would effectively prevent us from running test suites, since the first failure would indirectly cause all the following tests to fail.
> 
> Thanks for any ideas.
> 
> Alex
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>