[Webtest] Unconditionally executing some steps

Dierk Koenig webtest@lists.canoo.com
Fri, 6 Jan 2006 11:05:41 +0100


> 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>

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="relay myDynProp with value #{myDynpRrop} to myAntProp">
  step.project.properties.myAntProp = step.webtestProperties.myDynProp
</groovy>
- use ${myAntProp} in your cleanup steps

hope that helps
Mittie