[Webtest] Multiple <webtest> tags in one target

Josep García Josep García
Thu, 7 Jul 2011 09:25:44 +0200


--000e0cd567300079fb04a775a03d
Content-Type: text/plain; charset=ISO-8859-1

Try:
    <target name="run-all-tests"
        depends="xpressWSTest,xpressWSProcessingTest"
        description="Call and executes all test cases (targets)"/>

  <target name="xpressWSTest">
   <webtest name="xpress WS Production Test">
     <invoke
       url="http://url.com"
       description="xpress WS Test Production" />

       <verifyXPath description="CID" text="CID-0000002184319"
XPath="/ref:ONIXMessage/ref:
>
> Product//ref:ProductIdentifier/ref:IDValue"/>
>    </webtest>

</target>
>
>    <webtest name="xpressWSProcessingTest">
>      <invoke
>        url="http://url.com"
>        description="xpress WS Test Processing" />
>
>        <verifyXPath description="CID" text="CID-0000002184319"
> XPath="/ref:ONIXMessage/ref:Product/ref:ProductIdentifier/ref:IDValue"/>
>    </webtest>
>
>  </target>
>
Avoid blank spaces in webtest name. You can add description attribute with
textual description.

Cheers,
Josep

2011/7/5 Eric Bunton <buntone@bibliolabs.com>

> I currently have multiple webtest tags within one target/project while it
> runs all of the webtests I do not get the report for all of the tests.
> Looking at the output on the terminal I get a lot of exceptions thrown. Here
> is an example of my test file. I have cut out the actual url for privacy
> reasons. If anyone could help it would be greatly appreciated.
>
> <project name="xpress WS Test" basedir="." default="xpressWSTest">
>
>
>  <target name="xpressWSTest">
>    <webtest name="xpress WS Production Test">
>      <invoke
>        url="http://url.com"
>        description="xpress WS Test Production" />
>
>        <verifyXPath description="CID" text="CID-0000002184319"
> XPath="/ref:ONIXMessage/ref:Product//ref:ProductIdentifier/ref:IDValue"/>
>    </webtest>
>
>    <webtest name="xpressWSProcessingTest">
>      <invoke
>        url="http://url.com"
>        description="xpress WS Test Processing" />
>
>        <verifyXPath description="CID" text="CID-0000002184319"
> XPath="/ref:ONIXMessage/ref:Product/ref:ProductIdentifier/ref:IDValue"/>
>    </webtest>
>
>  </target>
> </project>_______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
>

--000e0cd567300079fb04a775a03d
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Try:<br>=A0=A0=A0 &lt;target name=3D&quot;run-all-tests&quot; <br>=A0=A0=A0=
=A0=A0=A0=A0 depends=3D&quot;xpressWSTest,xpressWSProcessingTest&quot;<br>=
=A0=A0=A0=A0=A0=A0=A0 description=3D&quot;Call and executes all test cases =
(targets)&quot;/&gt;<br><br>=A0
 &lt;target name=3D&quot;xpressWSTest&quot;&gt;<br>
 =A0 =A0&lt;webtest name=3D&quot;xpress WS Production Test&quot;&gt;<br>
 =A0 =A0 =A0&lt;invoke<br>
 =A0 =A0 =A0 =A0url=3D&quot;<a href=3D"http://url.com/" target=3D"_blank">h=
ttp://url.com</a>&quot;<br>
 =A0 =A0 =A0 =A0description=3D&quot;xpress WS Test Production&quot; /&gt;<b=
r>
<br>
 =A0 =A0 =A0 =A0&lt;verifyXPath description=3D&quot;CID&quot; text=3D&quot;=
CID-0000002184319&quot; XPath=3D&quot;/ref:ONIXMessage/ref:<blockquote clas=
s=3D"gmail_quote">Product//ref:ProductIdentifier/ref:IDValue&quot;/&gt;<br>
 =A0 =A0&lt;/webtest&gt;</blockquote><div></div><blockquote class=3D"gmail_=
quote">&lt;/target&gt;<br>

<br>
 =A0 =A0&lt;webtest name=3D&quot;xpressWSProcessingTest&quot;&gt;<br>
 =A0 =A0 =A0&lt;invoke<br>
 =A0 =A0 =A0 =A0url=3D&quot;<a href=3D"http://url.com/" target=3D"_blank">h=
ttp://url.com</a>&quot;<br>
 =A0 =A0 =A0 =A0description=3D&quot;xpress WS Test Processing&quot; /&gt;<b=
r>
<br>
 =A0 =A0 =A0 =A0&lt;verifyXPath description=3D&quot;CID&quot; text=3D&quot;=
CID-0000002184319&quot; XPath=3D&quot;/ref:ONIXMessage/ref:Product/ref:Prod=
uctIdentifier/ref:IDValue&quot;/&gt;<br>
 =A0 =A0&lt;/webtest&gt;<br>
<br>
 =A0&lt;/target&gt;<br>
</blockquote>Avoid blank spaces in webtest name. You can add description at=
tribute with textual description.<br><br>Cheers,<br>Josep<br><br><div class=
=3D"gmail_quote">2011/7/5 Eric Bunton <span dir=3D"ltr">&lt;<a href=3D"mail=
to:buntone@bibliolabs.com">buntone@bibliolabs.com</a>&gt;</span><br>
<blockquote class=3D"gmail_quote" style=3D"margin: 0pt 0pt 0pt 0.8ex; borde=
r-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">I currently have =
multiple webtest tags within one target/project while it runs all of the we=
btests I do not get the report for all of the tests. Looking at the output =
on the terminal I get a lot of exceptions thrown. Here is an example of my =
test file. I have cut out the actual url for privacy reasons. If anyone cou=
ld help it would be greatly appreciated.<br>

<br>
&lt;project name=3D&quot;xpress WS Test&quot; basedir=3D&quot;.&quot; defau=
lt=3D&quot;xpressWSTest&quot;&gt;<br>
<br>
<br>
 =A0&lt;target name=3D&quot;xpressWSTest&quot;&gt;<br>
 =A0 =A0&lt;webtest name=3D&quot;xpress WS Production Test&quot;&gt;<br>
 =A0 =A0 =A0&lt;invoke<br>
 =A0 =A0 =A0 =A0url=3D&quot;<a href=3D"http://url.com" target=3D"_blank">ht=
tp://url.com</a>&quot;<br>
 =A0 =A0 =A0 =A0description=3D&quot;xpress WS Test Production&quot; /&gt;<b=
r>
<br>
 =A0 =A0 =A0 =A0&lt;verifyXPath description=3D&quot;CID&quot; text=3D&quot;=
CID-0000002184319&quot; XPath=3D&quot;/ref:ONIXMessage/ref:Product//ref:Pro=
ductIdentifier/ref:IDValue&quot;/&gt;<br>
 =A0 =A0&lt;/webtest&gt;<br>
<br>
 =A0 =A0&lt;webtest name=3D&quot;xpressWSProcessingTest&quot;&gt;<br>
 =A0 =A0 =A0&lt;invoke<br>
 =A0 =A0 =A0 =A0url=3D&quot;<a href=3D"http://url.com" target=3D"_blank">ht=
tp://url.com</a>&quot;<br>
 =A0 =A0 =A0 =A0description=3D&quot;xpress WS Test Processing&quot; /&gt;<b=
r>
<br>
 =A0 =A0 =A0 =A0&lt;verifyXPath description=3D&quot;CID&quot; text=3D&quot;=
CID-0000002184319&quot; XPath=3D&quot;/ref:ONIXMessage/ref:Product/ref:Prod=
uctIdentifier/ref:IDValue&quot;/&gt;<br>
 =A0 =A0&lt;/webtest&gt;<br>
<br>
 =A0&lt;/target&gt;<br>
&lt;/project&gt;_______________________________________________<br>
WebTest mailing list<br>
<a href=3D"mailto:WebTest@lists.canoo.com">WebTest@lists.canoo.com</a><br>
<a href=3D"http://lists.canoo.com/mailman/listinfo/webtest" target=3D"_blan=
k">http://lists.canoo.com/mailman/listinfo/webtest</a><br>
</blockquote></div><br>

--000e0cd567300079fb04a775a03d--