[Webtest] custom exportproperty step

Dierk Koenig webtest@lists.canoo.com
Fri, 23 Jan 2004 16:02:22 +0100


Thanx a lot for the contribution!
It is excellent.

An addition to the documentation:
The ANT property is not set if already existing.
(The usual ANT property semantic.)

cheers
Mittie

> -----Original Message-----
> From: webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]On Behalf Of Janno Kusman
> Sent: Freitag, 23. Januar 2004 13:48
> To: webtest@lists.canoo.com
> Subject: [Webtest] custom exportproperty step
> 
> 
> Hi,
> 
> I have written my custom step that exports WebTest dynamic property as 
> ANT property.  It may be useful if you want to use ANT script task on 
> WebTest extracted property or if you simply want to debug WebTest 
> dynamic property value by using ANT echo task.
> 
> For building you need first to unzip src.zip in (WebTest home ) and copy 
> attached ExportProperty.java to 
> %WEBTEST.HOME%\src\com\canoo\webtest\extension
> 
> then run 'ant compile' and edit webtestTaskdefs.properties by adding 
> following line to it:
> exportproperty=com.canoo.webtest.extension.ExportProperty
> 
> Documentation:
> 
> *exportproperty*
> 
> Export WebTest dynamic property (which are not accesible outside WebTest 
> testspec) into ANT project properties
> 
> Attributes:
> name - The name of ANT project property that will be created
> value - WebTest dynamic property name to export as #{xxx}
> 
> Example:
> 
> <testSpec name="...">
>    <config ... />
>    <steps>
>       <invoke ... />
>         <storexpath
>             stepid="Extract href of first link on page"
>             xpath="//a[1]/@href"
>             property="uri" />
>         <invoke
>             stepid="Invoke target page specified in href"
>             url="#{uri}" />
>        
>         <exportproperty name="first_link" value="#{uri}"/>
>       ...
>    </steps>
> </testSpec>
> 
> <echo message="First link: ${first_link}"/>
> 
> BR,
> Janno Kusman
>