[Webtest] <repeat> bug?
Lisa Crispin
Lisa Crispin" <lisa.crispin@gmail.com
Mon, 6 Aug 2007 10:55:48 -0600
------=_Part_113439_30611750.1186419348747
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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) <Nathan.Hinks@ge.com> 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
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>
--
Lisa Crispin
Co-author,
Testing Extreme Programming
http://lisa.crispin.home.att.net
------=_Part_113439_30611750.1186419348747
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
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:<br><repeat count="4"><br> <storexpath xpath="#{count} + 1" property="index"/>
<br><br>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...<br>
-- Lisa<br><br><div><span class="gmail_quote">On 8/6/07, <b class="gmail_sendername">Hinks, Nathan (GE Healthcare)</b> <<a href="mailto:Nathan.Hinks@ge.com">Nathan.Hinks@ge.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
I've been trying to use a repeat step to check format in several tables<br>(ie, get the table with xpath, then parse multiple cells). I ran into a<br>problem whenever I had more steps inside the repeat step than the number
<br>of iterations of the repeat loop. Originally I figured it was just xml<br>syntax, so I created a couple very simple test cases and had the same<br>problem. Basically if you have the repeat step iterate n times, if<br>
there are n+1 or greater number of steps inside the loop, it will insert<br>an extra unexecuted step for each extra step. I can make a workaround<br>by just throwing all my steps in a <group> tag, but that's clumsy. It
<br>doesn't seem to be documented anywhere and I was curious if I'm missing<br>a solution.<br><br>For example:<br><br> <repeat count="1"><br> <verifyText text="td" />
<br> <verifyText text="tr" /><br> <echo>#{count}</echo><br> </repeat><br><br><br>Returned:<br> <step><br> <parameter name="count" value="1"/>
<br> <parameter name="taskName" value="repeat"/><br> <result><br> <completed duration="10"/><br> </result>
<br> <step><br> <parameter name="description" value="Iteration 0"/><br> <parameter name="taskName" value="iteration<br>
wrapper"/><br> <result><br> <completed duration="0"/><br> </result><br> <step><br> <parameter name="taskName" value="verifyText"/>
<br> <parameter name="text" value="td"/><br> <result><br> <completed duration="0"/><br> </result>
<br> </step><br> <step><br> <parameter name="taskName" value="verifyText"/><br> <parameter name="text" value="tr"/>
<br> <result><br> <completed duration="0"/><br> </result><br> </step><br> <step>
<br> <parameter name="nested text" value="0"/><br> <parameter name="taskName" value="echo"/><br> <result>
<br> <completed duration="0"/><br> </result><br> </step><br> </step><br> <step><br>
<parameter name="taskName" value="verifyText"/><br> <parameter name="text" value="tr"/><br> <result><br> <notexecuted duration="0"/>
<br> </result><br> </step><br> <step><br> <parameter name="nested text" value="#{count}"/><br> <parameter name="taskName" value="echo"/>
<br> <result><br> <notexecuted duration="0"/><br> </result><br> </step><br> </step><br><br>It doesn't interrupt the test or cause it to fail, but it's still rather
<br>annoying.<br><br>Thanks,<br><br>Nathan Hinks<br>_______________________________________________<br>WebTest mailing list<br><a href="mailto:WebTest@lists.canoo.com">WebTest@lists.canoo.com</a><br><a href="http://lists.canoo.com/mailman/listinfo/webtest">
http://lists.canoo.com/mailman/listinfo/webtest</a><br></blockquote></div><br><br clear="all"><br>-- <br>Lisa Crispin<br>Co-author, <br>Testing Extreme Programming<br><a href="http://lisa.crispin.home.att.net">http://lisa.crispin.home.att.net
</a>
------=_Part_113439_30611750.1186419348747--