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