How to preserve outputdir/images between test runs

8 views
Skip to first unread message

fratus

unread,
Nov 3, 2009, 9:44:40 AM11/3/09
to testng-users
I'm invoking testng through ant specifying a list of test.xml to
execute using xmlfileset. All tests are run from on single <testng>
call. I also save screen shots of errors in outputdir/images. The
problem I'm having is that the contents of outputdir/images are
deleted for every test defined in xmlfileset. Only the results of the
last test set executed are preserved.

Is there a flag to set in <testng> that will preserve the contents of
outputdir/images? Or, what do I have to do to run multiple tests in
one testng invocation and preserve the execution output from each
test.

Thanks,

Fernando

Cédric Beust ♔

unread,
Nov 3, 2009, 10:14:42 AM11/3/09
to testng...@googlegroups.com
Hi Fernando,

You could ask TestNG to generate its output in a different directory every time (maybe one named after the current date and time?).

--
Cédric

fratus

unread,
Nov 3, 2009, 10:56:34 AM11/3/09
to testng-users


On Nov 3, 10:14 am, Cédric Beust ♔ <cbe...@google.com> wrote:
> Hi Fernando,
>
> You could ask TestNG to generate its output in a different directory every
> time (maybe one named after the current date and time?).
>
> --
> ***Cédric
> *
>
>
>
> On Tue, Nov 3, 2009 at 6:44 AM, fratus <ffratace...@comcast.net> wrote:
>
> > I'm invoking testng through ant specifying a list of test.xml  to
> > execute using xmlfileset. All tests are run from on single <testng>
> > call. I also save screen shots of errors in outputdir/images. The
> > problem I'm having is that the contents of outputdir/images are
> > deleted for every test defined in xmlfileset. Only the results of the
> > last test set executed are preserved.
>
> > Is there a flag to set in <testng> that will preserve the contents of
> > outputdir/images? Or, what do I have to do to run multiple tests in
> > one testng invocation and preserve the execution output from each
> > test.
>
> > Thanks,
>
> > Fernando- Hide quoted text -
>
> - Show quoted text -

How can I do that? I'm doing one invocation of testng via ant in where
I already specify outputdir. For example:

<testng outputdir="test-output">
<xmlfileset dir"." includes="${xmlFileSet}"/> where
xmlFileset="Test1.xml,Test2.xml"
</testng>

I'm thinking that in order to do what you are saying I would have to
make individual invocations of <testng> each with it's own value for
outputdir. That's fine, but the problem I think I will run into is
creating once consolidated report.

Fernando

Harihara Vinayakaram

unread,
Nov 3, 2009, 11:01:59 AM11/3/09
to testng...@googlegroups.com
Ant has a <tstamp/> task which sets the values of properties TSAMP etc (http://ant.apache.org/manual/CoreTasks/tstamp.html).  So you can use something like

<testng outputdir="out/$TSTAMP/" >....

Hope that helps

Regards
Hari

fratus

unread,
Nov 3, 2009, 11:49:42 AM11/3/09
to testng-users

This did not work as <testng> is only invoked once from my ant task
therefore only one directory is created at runtime. All test suites
specified in xmlfileset have their output land in the same outputdir
therefore overwiting the contents of outpudir/images.

Am I missing something here?

Thanks,

Fernando

Cédric Beust ♔

unread,
Nov 3, 2009, 11:52:36 AM11/3/09
to testng...@googlegroups.com
What's this images/ directory?  It's not generated by TestNG, so is it coming from your code?

If it is, then you can adjust your code to add a time stamp to it...

--
Cédric

Reply all
Reply to author
Forward
0 new messages