Hi,
Are you getting an error message at some point?
We use the datadriven approach inside the actual testcase rather than in de
AllTests.xml:
<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../dtd/Project.dtd">
<project default="test">
<target name="test">
<dataDriven tableContainer="WebtestConfig.xls">
<webtest name="check ${ClientName} Login works">
<invoke url="http://${SITEIP}/login.aspx" description="Go to ${ClientName}
Login Page"/>
<setInputField xpath="//input[contains(@id,'txtUserName')]" value="XXXXXXXX" />
<setInputField name="txtPassword" value="XXXXXX" />
<clickButton htmlId="btnSubmit" />
<verifyText text="Dashboard"/>
</webtest>
</dataDriven>
</target>
</project>
But maybe it's the same thing.
Make sure the xls file has all the properties in the right case and does not
contain any spaces after the property names. So "ClientName" is okay, but
"clientName" is not and neither is "ClientName ".
Maybe you also need to check the path to the xls file.
Just a couple of thoughts.
Gert
> From: [email protected]
> To: [email protected]
> Subject: [Webtest] looping though suite of tests
> Date: Tue, 21 Jun 2011 17:54:55 -0400
>
> Hi,
>
> 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.
>
> Alltests.xml file:
> ------------------------
>
>
> <?xml version="1.0"?>
>
> <project default="test">
> <target name="test" description="runs all the tests">
> <dataDriven tableContainer="WebtestConfig.xls">
>
> <ant antfile="test_UserCanLogin.xml"/>
>
> </dataDriven>
>
> </target>
> </project>
>
>
> test_UserCanLogin.xml file:
> ======================
> <?xml version="1.0"?>
>
> <!DOCTYPE project SYSTEM "../dtd/Project.dtd">
>
> <project default="test">
>
> <target name="test">
> <webtest name="check ${ClientName} Login works">
>
>
> <invoke url="http://${SITEIP}/login.aspx" description="Go to
> ${ClientName} Login Page"/>
> <setInputField xpath="//input[contains(@id,'txtUserName')]" value="XXXXXXXX"
> />
> <setInputField name="txtPassword" value="XXXXXX" />
> <clickButton htmlId="btnSubmit" />
> <verifyText text="Dashboard"/>
>
> </webtest>
> </target>
> </project>
>
>
> 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".
>
> I'm not sure why the value from the xls file shows in <webtest> but
> not the test steps.
>
> I'm new to WebTest, 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
> [email protected]
> http://lists.canoo.com/mailman/listinfo/webtest