quality@glassfish.java.net

Re: Another TestNG question

From: Dies Koper <diesk_at_fast.au.fujitsu.com>
Date: Fri, 29 May 2009 10:36:33 +1000

Hi Lidia,

I have used the junitreport target for that.

     <!-- cannot use frames version on JDK5 because its Xalan is old -->
     <condition property="report.format" value="frames" else="noframes">
         <contains string="${java.version}" substring="1.4.2"/>
     </condition>
     <junitreport todir="reports/junit-style">
         <fileset dir="reports">
             <include name="**/*.xml"/>
             <exclude name="**/testng-failed.xml"/>
         </fileset>
         <report styledir="common/etc/xslt" format="${report.format}"
todir="reports/junit-style"/>
     </junitreport>

This assumes you specified a directory under "reports" as output
directory for all your test groups.

I used this on JDK1.4 and 5, and at the time there was an
incompatibility in the JDK bundled XML parser so that I could not use
the report with frames on JDK5. I had a java.version property set
somewhere so depending on its value I selected the report format.

The frames style looks nicer so hopefully that works for your JDK.

I've attached the style sheets I used. I think they were bundled with
Ant, I might have modified them a bit for our needs. Maybe you can
compare them with the ones in Ant and see which work best for you.

Regards,
Dies


Lidia Marchioni wrote:
> Hi all
>
> I'm not getting much luck with testng user forum, thus I'm trying it
> here. Would anyone know if there is an easy way to combine testng xml
> reports?
>
> I have a group of tests that use Selenium. The tests need to be
> executed on different browsers. I'm driving execution from ant, where I
> detect OS and execute tests on browsers specific to that OS. Thus
> testng task is called e.g. 3 times on windows: once for IE, once for
> FireFox and once for Safari. However, with this approach results are
> overwritten with each call to testng. I can specify different output
> directory for each browser/call to testng, but ideally I would like to
> have one report for all three browser runs. Is there a way to append to
> an existing xml output file? Do I need to merge the reports?
>
> Any insight appreciated.
>
> thanks
> lidia