2 messages in com.canoo.lists.webtest[Webtest] Re: incorrect usage of <sto...
FromSent OnAttachments
Kercher, John09 Mar 2006 04:25 
Marc Guillemot09 Mar 2006 06:13 
Subject:[Webtest] Re: incorrect usage of <storeProperty>?
From:Marc Guillemot (mgui@yahoo.fr)
Date:03/09/2006 06:13:14 AM
List:com.canoo.lists.webtest

Kercher, John <jkercher@...> writes:

Hello all...

I'm trying to use the <storeProperty> task to transform a dynamic property (the count property from the <repeat> task, specifically) into an ant property (which I need to use within a module). I couldn't get it to work properly. I have worked it down to this simple example:

<target name="testStoreProperty"> <webtest name="testsp"> &config; <steps> <echo>Property before storage: ${my.prop}</echo> <storeProperty name="my.prop" propertyType="ant" value="hello there"/> <echo>Property after storage: ${my.prop}</echo> </steps> </webtest> </target>

I expect the first <echo> to print "${my.prop}" since the property has not yet been defined and the second <echo> to print "hello there". However, the second <echo> still prints "${my.prop}". Am using <storeProperty> task incorrectly?

Hi John,

I think that you are using it correctly but webtest expands currently properties to early (at "parse time") what leads to this incorrect behavior. As long as it has not been changed, you can for instance use a workaround with a Groovy (or other script) step to access the property: <groovy> println 'Property after storage: ' + step.project.properties.'my.prop' </groovy>

Marc.