[Webtest] Repeat Actions

Piergiuliano Bossi webtest@lists.canoo.com
Thu, 30 Jan 2003 09:46:02 +0100


--------------81726D00BD7DE0ED82AE89AF
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I think this is more an ant issue. You may define a target in this way:

<target name="_InsertApple">
 <testSpec name="insert apple">
  <config host="${target}.quinary.it" port="${port}" protocol="http"
basepath="" summary="false" verbose="true" saveresponse="false"
haltonfailure="true" showhtmlparseroutput="true" />
  <steps>
   <invoke stepid="get main page" url="/seller/Home" />
   <clicklink stepid="clic on apple creation link" label="Create new apple"
/>
   <setinputfield stepid="set name" name="appleName" value="${apple.name}" />

   <setinputfield stepid="set weight" name="appleWeight"
value="${apple.weight}" />
   <clickbutton stepid="submit" label="Ok" />
  </steps>
 </testSpec>
</target>

Now you can invoke _InsertApple as many times you want, with different
parameters, using antcall :

<antcall target="_InsertApple">
  <param name="apple.name" value="appie" />
  <param name="apple.weight" value="3" />
</antcall>

HTH, Giuliano



Chris Hane wrote:

> Thanks, unfortunately I don't believe repeat gets me what I want.  Repeat
> does not allow for parameters to be dynamically modified between
> calls.  For example, pass one productID=12345 and pass two
> productID=9876.  Unless I'm missing something.....
>
> Chris....

--------------81726D00BD7DE0ED82AE89AF
Content-Type: text/html; charset=us-ascii
Content-Transfer-Encoding: 7bit

<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
I think this is more an ant issue. You may define a target in this way:
<p><tt><font color="#3333FF">&lt;target name="_InsertApple"></font></tt>
<br><tt><font color="#3333FF">&nbsp;&lt;testSpec name="insert apple"></font></tt>
<br><tt><font color="#3333FF">&nbsp; &lt;config host="${target}.quinary.it"
port="${port}" protocol="http" basepath="" summary="false" verbose="true"
saveresponse="false" haltonfailure="true" showhtmlparseroutput="true" /></font></tt>
<br><tt><font color="#3333FF">&nbsp; &lt;steps></font></tt>
<br><tt><font color="#3333FF">&nbsp;&nbsp; &lt;invoke stepid="get main
page" url="/seller/Home" /></font></tt>
<br><tt><font color="#3333FF">&nbsp;&nbsp; &lt;clicklink stepid="clic on
apple creation link" label="Create new apple" /></font></tt>
<br><tt><font color="#3333FF">&nbsp;&nbsp; &lt;setinputfield stepid="set
name" name="appleName" value="${apple.name}" /></font></tt>
<br><tt><font color="#3333FF">&nbsp;&nbsp; &lt;setinputfield stepid="set
weight" name="appleWeight" value="${apple.weight}" /></font></tt>
<br><tt><font color="#3333FF">&nbsp;&nbsp; &lt;clickbutton stepid="submit"
label="Ok" /></font></tt>
<br><tt><font color="#3333FF">&nbsp; &lt;/steps></font></tt>
<br><tt><font color="#3333FF">&nbsp;&lt;/testSpec></font></tt>
<br><tt><font color="#3333FF">&lt;/target></font></tt><tt><font color="#3333FF"></font></tt>
<p><font color="#000000">Now you can invoke _InsertApple as many times
you want, with different parameters, </font>using antcall <font color="#000000">:</font><font color="#000000"></font>
<p><tt><font color="#3333FF">&lt;antcall target="_InsertApple"></font></tt>
<br><tt><font color="#3333FF">&nbsp; &lt;param name="apple.name" value="appie"
/></font></tt>
<br><tt><font color="#3333FF">&nbsp; &lt;param name="apple.weight" value="3"
/></font></tt>
<br><tt><font color="#3333FF">&lt;/antcall></font></tt>
<p>HTH, Giuliano
<br>&nbsp;
<br>&nbsp;
<p>Chris Hane wrote:
<blockquote TYPE=CITE>Thanks, unfortunately I don't believe repeat gets
me what I want.&nbsp; Repeat
<br>does not allow for parameters to be dynamically modified between
<br>calls.&nbsp; For example, pass one productID=12345 and pass two
<br>productID=9876.&nbsp; Unless I'm missing something.....
<p>Chris....</blockquote>
</html>

--------------81726D00BD7DE0ED82AE89AF--