[Webtest] looping though suite of tests

Gert Pauwels Gert Pauwels <postino2800@hotmail.com>
Wed, 22 Jun 2011 08:41:51 +0200


--_253be067-84bb-423d-9355-10943c6f8594_
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable


Hi=2C
=20
Are you getting an error message at some point?=20
We use the datadriven approach inside the actual testcase rather than in de=
 AllTests.xml:

<?xml version=3D"1.0"?>
=20
 <!DOCTYPE project SYSTEM "../dtd/Project.dtd">
=20
 <project default=3D"test">
=20
 <target name=3D"test">
 <dataDriven tableContainer=3D"WebtestConfig.xls">
<webtest name=3D"check ${ClientName} Login works">
 =20
 <invoke url=3D"http://${SITEIP}/login.aspx" description=3D"Go to ${ClientN=
ame} Login Page"/>
 <setInputField xpath=3D"//input[contains(@id=2C'txtUserName')]" value=3D"X=
XXXXXXX" />
 <setInputField name=3D"txtPassword" value=3D"XXXXXX" />
 <clickButton htmlId=3D"btnSubmit" />
 <verifyText text=3D"Dashboard"/>
  </webtest>
</dataDriven>

 </target>
 </project>

But maybe it's the same thing.
=20
Make sure the xls file has all the properties in the right case and does no=
t contain any spaces after the property names. So "ClientName" is okay=2C b=
ut "clientName" is not and neither is "ClientName ".
Maybe you also need to check the path to the xls file.
=20
Just a couple of thoughts.
Gert
=20
> From: agiledood@gmail.com
> To: webtest@lists.canoo.com
> Subject: [Webtest] looping though suite of tests
> Date: Tue=2C 21 Jun 2011 17:54:55 -0400
>=20
> Hi=2C
>=20
> We're looking at Webtest to create some smoketests for our app. I am
> using DataDriven to grab a list of client sites to test and then
> running multiple tests in that loop but I can't seem to get properties
> working.
>=20
> Alltests.xml file:
> ------------------------
>=20
>=20
> <?xml version=3D"1.0"?>
>=20
> <project default=3D"test">
> <target name=3D"test" description=3D"runs all the tests">
> <dataDriven tableContainer=3D"WebtestConfig.xls">
>=20
> <ant antfile=3D"test_UserCanLogin.xml"/>
>=20
> </dataDriven>
>=20
> </target>
> </project>
>=20
>=20
> test_UserCanLogin.xml file:
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> <?xml version=3D"1.0"?>
>=20
> <!DOCTYPE project SYSTEM "../dtd/Project.dtd">
>=20
> <project default=3D"test">
>=20
> <target name=3D"test">
> <webtest name=3D"check ${ClientName} Login works">
>=20
>=20
> <invoke url=3D"http://${SITEIP}/login.aspx" description=3D"Go to
> ${ClientName} Login Page"/>
> <setInputField xpath=3D"//input[contains(@id=2C'txtUserName')]" value=3D"=
XXXXXXXX" />
> <setInputField name=3D"txtPassword" value=3D"XXXXXX" />
> <clickButton htmlId=3D"btnSubmit" />
> <verifyText text=3D"Dashboard"/>
>=20
> </webtest>
> </target>
> </project>
>=20
>=20
> When the running test output is echo'd in the java console I see the
> property from the xls config file is generated "check MyClient Login
> works". The actual test steps themselves show ${ClientName} instead
> of "MyClient".
>=20
> I'm not sure why the value from the xls file shows in <webtest> but
> not the test steps.
>=20
> I'm new to WebTest=2C any ideas or should I look at Groovy to do
> something like this? (I'm not a programmer by the way...) Basically
> our goal is to smoketest the same functionality for multiple client
> sites as post-deployment validation.
> _______________________________________________
> WebTest mailing list
> WebTest@lists.canoo.com
> http://lists.canoo.com/mailman/listinfo/webtest
 		 	   		  =

--_253be067-84bb-423d-9355-10943c6f8594_
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<html>
<head>
<style><!--
.hmmessage P
{
margin:0px=3B
padding:0px
}
body.hmmessage
{
font-size: 10pt=3B
font-family:Tahoma
}
--></style>
</head>
<body class=3D'hmmessage'><div dir=3D'ltr'>
Hi=2C<BR>
<P id=3DSkyDrivePlaceholder>&nbsp=3B</P>
Are you getting an error message at some point? <BR>
We use the datadriven approach inside the actual testcase rather than in de=
 AllTests.xml:<BR>
<BR>&lt=3B?xml version=3D"1.0"?&gt=3B<BR>&nbsp=3B<BR> &lt=3B!DOCTYPE projec=
t SYSTEM "../dtd/Project.dtd"&gt=3B<BR>&nbsp=3B<BR> &lt=3Bproject default=
=3D"test"&gt=3B<BR>&nbsp=3B<BR> &lt=3Btarget name=3D"test"&gt=3B<BR>&nbsp=
=3B&lt=3BdataDriven tableContainer=3D"WebtestConfig.xls"&gt=3B<BR>
&lt=3Bwebtest name=3D"check ${ClientName} Login works"&gt=3B<BR>&nbsp=3B&nb=
sp=3B<BR> &lt=3Binvoke url=3D"http://${SITEIP}/login.aspx" description=3D"G=
o to ${ClientName} Login Page"/&gt=3B<BR>&nbsp=3B&lt=3BsetInputField xpath=
=3D"//input[contains(@id=2C'txtUserName')]" value=3D"XXXXXXXX" /&gt=3B<BR>&=
nbsp=3B&lt=3BsetInputField name=3D"txtPassword" value=3D"XXXXXX" /&gt=3B<BR=
>&nbsp=3B&lt=3BclickButton htmlId=3D"btnSubmit" /&gt=3B<BR>&nbsp=3B&lt=3Bve=
rifyText text=3D"Dashboard"/&gt=3B<BR>&nbsp=3B &lt=3B/webtest&gt=3B<BR>
&lt=3B/dataDriven&gt=3B<BR><BR>&nbsp=3B&lt=3B/target&gt=3B<BR>&nbsp=3B&lt=
=3B/project&gt=3B<BR><BR>
But maybe it's the same thing.<BR>
&nbsp=3B<BR>
Make sure the xls file has all the properties in the right case and does no=
t contain any spaces after the property names. So "ClientName" is okay=2C b=
ut "clientName" is not and neither is "ClientName ".<BR>
Maybe you also need to check the path to the xls file.<BR>
&nbsp=3B<BR>
Just a couple of thoughts.<BR>
Gert<BR>
&nbsp=3B<BR>
&gt=3B From: agiledood@gmail.com<BR>&gt=3B To: webtest@lists.canoo.com<BR>&=
gt=3B Subject: [Webtest] looping though suite of tests<BR>&gt=3B Date: Tue=
=2C 21 Jun 2011 17:54:55 -0400<BR>&gt=3B <BR>&gt=3B Hi=2C<BR>&gt=3B <BR>&gt=
=3B We're looking at Webtest to create some smoketests for our app. I am<BR=
>&gt=3B using DataDriven to grab a list of client sites to test and then<BR=
>&gt=3B running multiple tests in that loop but I can't seem to get propert=
ies<BR>&gt=3B working.<BR>&gt=3B <BR>&gt=3B Alltests.xml file:<BR>&gt=3B --=
----------------------<BR>&gt=3B <BR>&gt=3B <BR>&gt=3B &lt=3B?xml version=
=3D"1.0"?&gt=3B<BR>&gt=3B <BR>&gt=3B &lt=3Bproject default=3D"test"&gt=3B<B=
R>&gt=3B &lt=3Btarget name=3D"test" description=3D"runs all the tests"&gt=
=3B<BR>&gt=3B &lt=3BdataDriven tableContainer=3D"WebtestConfig.xls"&gt=3B<B=
R>&gt=3B <BR>&gt=3B &lt=3Bant antfile=3D"test_UserCanLogin.xml"/&gt=3B<BR>&=
gt=3B <BR>&gt=3B &lt=3B/dataDriven&gt=3B<BR>&gt=3B <BR>&gt=3B &lt=3B/target=
&gt=3B<BR>&gt=3B &lt=3B/project&gt=3B<BR>&gt=3B <BR>&gt=3B <BR>&gt=3B test_=
UserCanLogin.xml file:<BR>&gt=3B =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D<BR>&gt=3B &lt=3B?xml version=3D"1.0"?&gt=3B<BR>&gt=
=3B <BR>&gt=3B &lt=3B!DOCTYPE project SYSTEM "../dtd/Project.dtd"&gt=3B<BR>=
&gt=3B <BR>&gt=3B &lt=3Bproject default=3D"test"&gt=3B<BR>&gt=3B <BR>&gt=3B=
 &lt=3Btarget name=3D"test"&gt=3B<BR>&gt=3B &lt=3Bwebtest name=3D"check ${C=
lientName} Login works"&gt=3B<BR>&gt=3B <BR>&gt=3B <BR>&gt=3B &lt=3Binvoke =
url=3D"http://${SITEIP}/login.aspx" description=3D"Go to<BR>&gt=3B ${Client=
Name} Login Page"/&gt=3B<BR>&gt=3B &lt=3BsetInputField xpath=3D"//input[con=
tains(@id=2C'txtUserName')]" value=3D"XXXXXXXX" /&gt=3B<BR>&gt=3B &lt=3Bset=
InputField name=3D"txtPassword" value=3D"XXXXXX" /&gt=3B<BR>&gt=3B &lt=3Bcl=
ickButton htmlId=3D"btnSubmit" /&gt=3B<BR>&gt=3B &lt=3BverifyText text=3D"D=
ashboard"/&gt=3B<BR>&gt=3B <BR>&gt=3B &lt=3B/webtest&gt=3B<BR>&gt=3B &lt=3B=
/target&gt=3B<BR>&gt=3B &lt=3B/project&gt=3B<BR>&gt=3B <BR>&gt=3B <BR>&gt=
=3B When the running test output is echo'd in the java console I see the<BR=
>&gt=3B property from the xls config file is generated "check MyClient Logi=
n<BR>&gt=3B works". The actual test steps themselves show ${ClientName} ins=
tead<BR>&gt=3B of "MyClient".<BR>&gt=3B <BR>&gt=3B I'm not sure why the val=
ue from the xls file shows in &lt=3Bwebtest&gt=3B but<BR>&gt=3B not the tes=
t steps.<BR>&gt=3B <BR>&gt=3B I'm new to WebTest=2C any ideas or should I l=
ook at Groovy to do<BR>&gt=3B something like this? (I'm not a programmer by=
 the way...) Basically<BR>&gt=3B our goal is to smoketest the same function=
ality for multiple client<BR>&gt=3B sites as post-deployment validation.<BR=
>&gt=3B _______________________________________________<BR>&gt=3B WebTest m=
ailing list<BR>&gt=3B WebTest@lists.canoo.com<BR>&gt=3B http://lists.canoo.=
com/mailman/listinfo/webtest<BR><BR> 		 	   		  </div></body>
</html>=

--_253be067-84bb-423d-9355-10943c6f8594_--