[testng-users] Different reporter output in eclipse vs. ant/shell

84 views
Skip to first unread message

Jostar

unread,
May 21, 2012, 5:54:34 AM5/21/12
to testng...@googlegroups.com

I allready wondered about why the report produced by TestNG is looking
totally different when TestNG is called in eclipse (via the plugin) than
when it is called in the shell (java org.testng.TestNG ...) or the
ant-Target <testng>.
So far, i got used to it with the assumption that the reason for the
simplier report format in eclipse has someting to do with the needed ability
of the plugin to interprete the report for the graphical view?

What really bothers me now is that any information i add to the html-report
with the static Reporter.log() method within a method annotated with
@After-/BeforeMethod is just shown in the eclipse-report and not at all in
ant/shell-report.
It looks like the only supported place to call a striking Reporter.log() for
ant/shell is the test-method (@Test) itself.

Any particular reason for that and do i really have to use the Reporter API
and an own Repoter for my need?

Thx in advance for any help!

b.t.w., i'm using TestNG in Version 6.5.1
--
View this message in context: http://old.nabble.com/Different-reporter-output-in-eclipse-vs.-ant-shell-tp33881684p33881684.html
Sent from the testng-users mailing list archive at Nabble.com.

Cédric Beust ♔

unread,
May 21, 2012, 11:20:32 AM5/21/12
to testng...@googlegroups.com
Reporter.log() should definitely add its output to the HTML report, can you post a screen shot of what you mean?

Thanks.

-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To post to this group, send email to testng...@googlegroups.com.
To unsubscribe from this group, send email to testng-users...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.


Jostar

unread,
May 22, 2012, 3:43:04 AM5/22/12
to testng...@googlegroups.com

Sure i can! :-)

Using the code below for any Test-Class and a testng.xml where it gets
executed in a suite,
i get the following two reports and Results/Summary views when executed in
ecplise (via plugin) and the shell respectively.

As you can see, in the second report
(Screenshot_ShellReport_ReportOutput.png) the lines from the @BeforeClass
methods ("Report entry before ClassA/B") are missing.
B.t.w. i neither get the line from the test-method ("Report entry from
within testA2") within the summary of the shell-report
(Screenshot_ShellReport_Summary.png) as i would expect it. So i have
explicitely to look at the "reporter output" and i loose the information
from which test-method which report-line was raised.

Hope that helps

Arno

Screenshot_EclipseReport_ReporterOutput.png
http://old.nabble.com/file/p33887467/Screenshot_EclipseReport_ReporterOutput.png

Screenshot_ShellReport_ReportOutput.png
http://old.nabble.com/file/p33887467/Screenshot_ShellReport_ReportOutput.png

Screenshot_EclipseReport_Results.png
http://old.nabble.com/file/p33887467/Screenshot_EclipseReport_Results.png

Screenshot_ShellReport_Summary.png
http://old.nabble.com/file/p33887467/Screenshot_ShellReport_Summary.png



------ code snipped of ClassA.java -----
@BeforeClass
public void classFromA()
{
System.out.println ("BeforeClass from A");
Reporter.log ("Report entry before ClassA");
}

@Test
public void testA1()
{
System.out.println (" - testA1");
}

@Test
public void testA2()
{
System.out.println (" - testA2");
Reporter.log ("Report entry from within testA2");
}

@Test(dependsOnMethods={"testA1","testA2"})
public void testA3()
{
System.out.println (" - testA3");
View this message in context: http://old.nabble.com/Different-reporter-output-in-eclipse-vs.-ant-shell-tp33881684p33887467.html

Jostar

unread,
May 24, 2012, 2:19:53 AM5/24/12
to testng...@googlegroups.com

I realized, that the "old style" reports (screenshots 1 and 3) are coming
from the old testng eclipse pluging that is installed in our central eclipse
distribution (version 6.1.1.20110713_1401).

After installing locally a newer version (6.4.0.20120308_1617) the reports
from within eclipse are like the ones from the shell or ant, thus with
missing entries in the report output.

As often, sadly, an update of a technology/tool for increased optical
comfort came along with decreased functionality... ;)

greets,
Arno
--
View this message in context: http://old.nabble.com/Different-reporter-output-in-eclipse-vs.-ant-shell-tp33881684p33900089.html

Sushma Kurella

unread,
Jun 10, 2014, 6:43:42 PM6/10/14
to testng...@googlegroups.com, arno...@hispeed.ch
Hi Jostar,

I have a similar issue.
i couldnt open the pages you posted ( http://old.nabble.com.....).
Pls help me out.

Thanks in advance
Reply all
Reply to author
Forward
0 new messages