Hi!
Thanks a lot for your fast answer. Came across a similiar solution just
a short time after my posting (as usual). I tried using jacaScript but
had one problem. How can I access the static ant properties within the
scriptstep?
I know there are the two methods step.getWebtestPrperty(..) and
step.setWebtestProperty(...) to use the dynamic properties. Is there an
equivalent for static properties?
Daniel
Denis N. Antonioli schrieb:
Hi Daniel
On 28 févr. 06, at 15:18, Daniel Brenner wrote:
I got a number of properties called "property_0", "property_1",
"property_2", "property_3", .... , "property_n". I would like to use
all of them for a verifyText. I would like to use the "repeat" step
to make the code for the test as easy as possible. So what I am
looking for is a possibility to use the property "property_i" (i is
the counter of the repeat step) within the verifyText. I tried
several hours to find a solution but nothing did work.
You can use groovy to achieve this result:
<repeat count="${property.count}">
<scriptStep language="groovy" >
/*
* Use this script in loop to access numbered properties.
* In:
* #{count}: counter set by repeat, start at 0
* ${property_0}, ${property_1}, ${property_2}, ...
* Out:
* #{checkMe} <- value of ${property_#{count}}
*/
def count = step.webtestProperties.count;
step.webtestProperties.checkMe =
step.project.properties['property_'+count]
project.log(count + ': ' + step.webtestProperties.checkMe)
</scriptStep>
<verifyText text="#{checkMe}" />
</repeat>
A fine point is that the groovy script must generate a webtest, aka
dynamic, property, otherwise it won't work!
Happy testing
dna
--A good messenger expects to get shot.
-- Larry Wall
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest