RE: looping though suite of tests

"Tim Pezarro" <Tim_Pezarro-4W7cOCfLBmzY0TyS/[email protected]>
Newsgroups gmane.comp.web.canoo.webtest
Message-ID <[email protected]_nt.nt.pmc-sierra.bc.ca>
Jason,

We use the dataDriven all the time in webtest scripts without problem.

Is it possible there is a typo in the header row of your excel spreadsheet? This header row has the name of the properties that are to be replaced in your script.

Here is a working example from  our suite:

<?xml version="1.0"?>
<!DOCTYPE project SYSTEM "../../dtd/Project.dtd">
<project default="keywords">
  <target name="keywords">
    <dataDriven tableContainer="properties/adaptec/keywords.xls">
      <webtest name="keyword regression test on ${domain}${page}"  >
        <config
          autorefresh="true"
          haltonerror = "false"
          haltonfailure = "false"
          easyajax="true"
          useInsecureSSL="true"
		  browser="FF3">
          <option name="ThrowExceptionOnFailingStatusCode" value="false"/>
          <option name="ThrowExceptionOnScriptError" value="false" />
        </config>
        <steps>
          <invoke
            url="${domain}${page}" 
            description="Find keyword on ${domain}${page}" />
       	  <verifyText text="${keyword.1}" />
          <verifyText text="${keyword.2}" />
          <verifyText text="${header}" />
          <verifyText text="${footer}" />
          <not>
            <verifyText text="an error occurred while processing this directive" /> 
          </not>   
          <verifyImages />
        </steps>
      </webtest>
    </dataDriven>
  </target>
</project>

Attached is a sample of a working excel spreadsheet for this test.

Cheers,

Tim Pezarro
Manager, Web Services
Corporate Marketing
tim_pezarro-4W7cOCfLBmzY0TyS/[email protected]
Phone: +1-604-415-6044
Cell: +1-604-762-1000
Fax: +1-604-415-6602
PMC-Sierra, Inc.
8555 Baxter Place
Burnaby, BC, Canada
V5A 4V7



-----Original Message-----
From: [email protected] on behalf of Jason Little
Sent: Tue 6/21/2011 2:54 PM
To: [email protected]
Subject: [Webtest] looping though suite of tests
 
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
keywords.xls (application/ms-excel, 6.5 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.