[Webtest] new Custom step EncodeProperty added to community site

Paul King webtest@lists.canoo.com
Fri, 20 Aug 2004 12:07:56 +1000


http://webtest-community.canoo.com/wiki/space/EncodeProperty

EncodeProperty description:

This step URLEncodes a webtest dynamic property. This is useful if you 
are extracting or generating properties which contain spaces or other 
special characters and using them later in situations where these 
characters would be a problem (e.g. further script processing or to 
simulate situations where browsers would normally automatically encode).

Example:

For the following HTML:

<a id="x" href="my external file!.pdf">Click  here to see pdf</a>

The following steps:

<storexpath stepid="Store link"
   xpath="//a[@id='x']/@href'" property="theUrl"/>
<encodeProperty property="theUrl" encoding="UTF-8" />

will leave the property containing the following value:

my+external+file%21.pdf

which can then be used in subsequent invokes etc.

Cheers, Paul.
P.S. This step makes StoreEncodedXPath (which combines the above two 
steps into one step) obsolete and has the advantage of being able to be 
used with StoreRegex, StoreRandom, Scripting etc.