[Webtest] Re: Custom Step StoreEncodedXPath added to the community site

Paul King webtest@lists.canoo.com
Tue, 10 Aug 2004 07:36:35 +1000


Marc Guillemot wrote:

> as far as I understand, the extracted link will then be used in an 
> <invoke ...>.
> What with an additional "encodeUrl" attribute for <invoke ../>?
> 
> <storexpath stepid="Extract badly formatted link" 
> xpath="//a[@id='x']/@href'" property="theUrl1"/>
> <invoke url="#{theUrl1}" encodeUrl="true"/>

All the use cases we have at the moment involve <invoke> or 
<invokeRelative> (custom step yet to be posted). However, it is also 
potentially useful for other tasks like <sethiddenfield> or scripting 
(<scriptStep> is also yet to be posted).

> Roman Moukhine [ram] wrote:
> 
>> Hello everybody
>>
>> I have a suggestion.
>>
>> Either we should include this step instead of StoreXPath and provide 
>> respectivly <storeregex> (like original but with "enc" attribute)  or 
>> we should extract encoding in separate step. That could improve 
>> granularity and reusablity:
>>
>>  <storexpath stepid="Check for link" xpath="//a[@id='x']/@href'" 
>> property="theUrl1"/>
>> <urlencode text="#{theUrl1}"  toproperty="urlencoded" /> <!-- store 
>> encoded into new property-->
>> <urlencode text="#{theUrl1}"  toproperty="theUrl1" /> <!-- replace 
>> with urlencoded value-->