[Webtest] Unconditionally executing some steps

Curelea, Alexandru webtest@lists.canoo.com
Fri, 6 Jan 2006 09:51:14 -0500


Thanks for the help everyone.  I ended up doing pretty much what Mittie =
said (just without the groovy scripting - it looks like it's something =
worth learning eventually).  It's slightly roundabout, but it works =
perfectly.

Just for the record, for this application it'd be very difficult to =
avoid deleting the test data.  It's a scheduling application, so any new =
"appointment" uses up some resources that will, eventually, conflict =
with something they're not supposed to if the appointment isn't removed.

Something like an <alwaysExecute> step might be useful in the future - =
and probably the most elegant solution for this specific problem.  Of =
course, the implementation might not be trivial.

But I'm perfectly happy with the solution I have - thanks again!

Alex

-----Original Message-----
From: webtest-admin@gate2.canoo.com
[mailto:webtest-admin@gate2.canoo.com]On Behalf Of Dierk Koenig
Sent: Friday, January 06, 2006 5:06 AM
To: webtest@gate2.canoo.com
Subject: RE: [Webtest] Unconditionally executing some steps


> 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=3D"change config">
>   step.context.testSpecification.config.haltonerror =3D false
> </groovy>

That's correct as such but I'm afraid it doesn't solve the problem.

The meaning of haltonerror and haltonfailure is only whether trailing
webtests are executed or not. Trailing _steps_ within the same webtest =
are
never executed.

So you have to put it into a trailing webtest.

When you need (like for cleanup reasons here) you need access to the =
dynamic
properties from a predecessor webtest you just cannot, because they are
stored in the webtest 'scope'. You need to use ANT properties as they =
belong
to the Ant project scope.

Alexandru:
- set the haltonXXX properties to false in your config
- make a trailing <webtest> for your cleanup steps
- relay your dynamic properties to ANT properties with the accordings =
steps
<storeProperty> and such or alternatively use
<groovy description=3D"relay myDynProp with value #{myDynpRrop} to =
myAntProp">
  step.project.properties.myAntProp =3D step.webtestProperties.myDynProp
</groovy>
- use ${myAntProp} in your cleanup steps

hope that helps
Mittie

_______________________________________________
WebTest mailing list
WebTest@lists.canoo.com
http://lists.canoo.com/mailman/listinfo/webtest