[Webtest] Repeat property expansion question
Marc Guillemot
webtest@lists.canoo.com
Wed, 17 Dec 2003 14:02:38 +0100
Hi,
perhaps could we imagine changing the way an expression is evaluated.
For example if we have inside a repeat loop:
<setinputfield name="toto" value="#{test.loopValue.#{count}}"/>
we could consider that "#{test.loopValue.#{count}}" gets evaluated using
following steps:
- evaluate nested prop "#{count}" using the "count" value from the webtest
dynamic property "count". If current value is "1", we would then have
"#{test.loopValue.1}"
- if there is a webtest dynamic property with name "test.loopValue.1" then take it
- else try to evaluate it using ant's project properties.
Not sure that my explaination is understandable, but it seems to me that it
would be possible to greatly enhance the webtest dynamic properties without
breaking existing behaviour.
Marc.
Dierk Koenig wrote:
> Hi,
>
> The problem here ist that the ${} property is evaluated by ant before
> webtest has a chance to see it.
> #{} is evaluated by webtest.
> Making the usage below possible through an ant task would be fairly tricky.
>
> cheers
> Mittie
>
> -----Original Message-----
> *From:* webtest-admin@lists.canoo.com
> [mailto:webtest-admin@lists.canoo.com]*On Behalf Of
> *David.Howard@cambista.net
> *Sent:* Mittwoch, 17. Dezember 2003 11:08
> *To:* webtest@lists.canoo.com
> *Subject:* [Webtest] Repeat property expansion question
>
>
> When creating a loop it would be very useful to be able to have the
> loop count loaded from a property file, and then have each of the
> values used within the loop also loaded from properties. Thus a
> property file might contain:
>
> test.loopCount=4
> test.loopValue.0=A
> test.loopValue.1=B
> test.loopValue.2=C
> test.loopValue.3=D
>
> To achieve this we seem to need an ant expression of the style
> "${test.loopValue#{count}}" to evaluate correctly.
> Is there a way of doing this?
>
> ___________
> Cambista Technologies... www.Cambista.net
> David Howard, Senior Technical Consultant.