Hi there, 

I found it very helpful to use the "dir" attribute along with the "antfile". 
I'll explain below.

E.g., we have one parent folder that has a build.xml and a webtest xml file 
that holds references to all tests to be executed.
These tests (separate files) are located in subdirectories of a sibling folder 
of the "parent" folder, like:

- parent_dir (we run "webtest.sh" from here)
  -- build.xml
  -- alltests.xml
- testcases_dir
  -- testtopic_1
     --- test1.xml
     --- test2.xml
  -- testtopic_2
     --- test3.xml
     --- test4.xml

What we wanted to have is a SINGLE big report in ONE directory to hold all 
results.
The easiest way for us to do this was to use (in the "alltests.xml") the 
following notation:

    <ant antfile="test4.xml" dir="../testcases_dir/testtopic_2" />

Okay, you might say, "this is the same like"...:

    <ant antfile="../testcases_dir/testtopic_2/test4.xml" />

...is it? NOPE! I consider this an IMPORTANT fact which is yet little mentioned.
( Not everyone who is testing software knows the nuts and bolts of ANT by 
heart! ANT is a developer tool. Keep this in mind. )

The way we organized our test directories enables us to re-use the same 
test4.xml file from inside its containing folder and run it there, creating a 
dedicated "results" folder for the test only in the same directory. If we want 
/ need that.

Hope this helps (especially the "noobs" like me... Or like I was some weeks ago)

Thomas Klein

Senior Associate, QA | Sapient

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of wing-tung Leung
Sent: Thursday, February 04, 2010 5:41 PM
To: [email protected]; Iain_10
Subject: Re: [Webtest] Organising Tests for WebTest

On Thu, Feb 4, 2010 at 4:40 PM, Iain_10 <[email protected]> wrote:
> I am looking at the best way to organise my Web Tests.

I guess there is no "BEST" way to organize your tests. It depends on
your amount of tests scripts, and your test scenario's.

We have rather a limited set of test files (roughly 20), and we store
them all inside a single "tests" directory. Names of the file either
refer to the tested functionality, or to the issue ID from the bug
tracking system.

> But it doesn't seem to execute the tests in myTest2.xml.

I guess you miss a reference to "myTest2.xml".

In our case, the global "build.xml" contains the property
"wt.testInWork" referring to "tests/allests.xml". The latter file
contains a list of all test files, each one listed with separate <ant>
tag. Not really advanced, I suggest that you get it working first, and
grow into a more formal structure when you feel the need.

Example content "allTests.xml":

<project default="test">
    <target name="test" description="runs all the tests">
        <ant antfile="test1.xml"/>
        <ant antfile="test2.xml"/>
        <ant antfile="test3.xml"/>
   </target>
</project>


BTW, please quote mails inline, and enter your remarks inline is as
well. Makes following threads much easier.

Regards,

Tung
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest
_______________________________________________
WebTest mailing list
[email protected]
http://lists.canoo.com/mailman/listinfo/webtest

Reply via email to