It's been so long since I wrote the tests we have that use repeat it's hard
for me to say, but I notice I have this syntax:
<repeat count="4">
<storexpath xpath="#{count} + 1" property="index"/>
I don't remember why I did it that way, and it's probably ancient outdated
syntax since these tests are 3 years old, but I haven't noticed any strange
behavior. On the off chance that is helpful...
-- Lisa
On 8/6/07, Hinks, Nathan (GE Healthcare) <[EMAIL PROTECTED]> wrote:
>
> I've been trying to use a repeat step to check format in several tables
> (ie, get the table with xpath, then parse multiple cells). I ran into a
> problem whenever I had more steps inside the repeat step than the number
> of iterations of the repeat loop. Originally I figured it was just xml
> syntax, so I created a couple very simple test cases and had the same
> problem. Basically if you have the repeat step iterate n times, if
> there are n+1 or greater number of steps inside the loop, it will insert
> an extra unexecuted step for each extra step. I can make a workaround
> by just throwing all my steps in a <group> tag, but that's clumsy. It
> doesn't seem to be documented anywhere and I was curious if I'm missing
> a solution.
>
> For example:
>
> <repeat count="1">
> <verifyText text="td" />
> <verifyText text="tr" />
> <echo>#{count}</echo>
> </repeat>
>
>
> Returned:
> <step>
> <parameter name="count" value="1"/>
> <parameter name="taskName" value="repeat"/>
> <result>
> <completed duration="10"/>
> </result>
> <step>
> <parameter name="description" value="Iteration 0"/>
> <parameter name="taskName" value="iteration
> wrapper"/>
> <result>
> <completed duration="0"/>
> </result>
> <step>
> <parameter name="taskName" value="verifyText"/>
> <parameter name="text" value="td"/>
> <result>
> <completed duration="0"/>
> </result>
> </step>
> <step>
> <parameter name="taskName" value="verifyText"/>
> <parameter name="text" value="tr"/>
> <result>
> <completed duration="0"/>
> </result>
> </step>
> <step>
> <parameter name="nested text" value="0"/>
> <parameter name="taskName" value="echo"/>
> <result>
> <completed duration="0"/>
> </result>
> </step>
> </step>
> <step>
> <parameter name="taskName" value="verifyText"/>
> <parameter name="text" value="tr"/>
> <result>
> <notexecuted duration="0"/>
> </result>
> </step>
> <step>
> <parameter name="nested text" value="#{count}"/>
> <parameter name="taskName" value="echo"/>
> <result>
> <notexecuted duration="0"/>
> </result>
> </step>
> </step>
>
> It doesn't interrupt the test or cause it to fail, but it's still rather
> annoying.
>
> Thanks,
>
> Nathan Hinks
> _______________________________________________
> WebTest mailing list
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest
>
--
Lisa Crispin
Co-author,
Testing Extreme Programming
http://lisa.crispin.home.att.net