Reporter logs are not shown in Reporter Ouput

1,196 views
Skip to first unread message

Gulshan Saini

unread,
Jun 19, 2012, 9:57:09 AM6/19/12
to testng...@googlegroups.com
Hi Cedric,

I am trying to log info using org.testng.Reporter class as follows:

Reporter.log("FAILED FAILED FAILED");
Reporter.log("<a href='abc.html'>HREF</a>");

It is not showing in new reports.

Thanks
Gulshan

edwolb

unread,
Jun 19, 2012, 11:34:22 AM6/19/12
to testng...@googlegroups.com
Ha, what a coincidence, I'm having this same problem.  I'm using the beta level code, not sure if that has anything to do with it.  I've never tried it before, so its possible I'm just doing it wrong, but it seems pretty straight forward.

--
Chris

edwolb

unread,
Jun 19, 2012, 11:37:13 AM6/19/12
to testng...@googlegroups.com
Nope, using 6.5.1, I still can't get the log to output anything.  I tried updating my verbosity to 1 in the suite file, and still no luck.  I've confirmed through debugging and through a system.out.println to console that the code is executing, but it doesn't seem to go anywhere.

I'm looking in the test-output/index.html file by the way.

--
Chris

Cédric Beust ♔

unread,
Jun 19, 2012, 1:32:24 PM6/19/12
to testng...@googlegroups.com
Are you looking at the right place? (see screen shot)

Inline image 1
-- 
Cédric




--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To view this discussion on the web visit https://groups.google.com/d/msg/testng-users/-/2iSzk66v9aEJ.

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.

Screen Shot 2012-06-19 at 10.31.45 AM.png

Gulshan Saini

unread,
Jun 19, 2012, 2:18:58 PM6/19/12
to testng...@googlegroups.com
Yes, I am looking at right place. But it is not showing :(
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.

Chris

unread,
Jun 19, 2012, 2:42:28 PM6/19/12
to testng...@googlegroups.com
Yes, here's my setup:

Listener class (partial):


public class ScreenshotListener extends TestListenerAdapter {
  public ScreenshotListener() {
    super();
  }
  
  public void onTestFailure(ITestResult tr) {
    System.out.print("FAILED: ");
    Reporter.log("TEST123");
    File screenShot;
    try
    {
      screenShot = getScreenShot(tr);
      if (screenShot != null) {
     System.out.println("Screenshot taken: " + screenShot.getPath());

......


XML suite (partial):

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="CsvSampleSuite" verbose="1">
  <listeners>
  <listener class-name="com.automation.lib.listen.ScreenshotListener" />
  </listeners>
.............


Execution console output:

FAILED: Screenshot taken: test-output\SS-test-120619113526723.png


Raw HTML output of the "reporter" section:

<div panel-name="reporter-CsvSampleSuite" class="panel"> 
<div class="main-panel-header rounded-window-top">
<span class="header-content">Reporter output for CsvSampleSuite</span>
</div> <!-- main-panel-header rounded-window-top -->
<div class="main-panel-content rounded-window-bottom">
</div> <!-- main-panel-content rounded-window-bottom -->
</div> <!-- panel -->

Here's the screenshot:

Inline image 1

Am I missing a step?

--
Chris
Screen Shot 2012-06-19 at 10.31.45 AM.png
image.png

edwolb

unread,
Jun 21, 2012, 9:02:16 AM6/21/12
to testng...@googlegroups.com
Another interesting note..  After installing ReportNG, the output is showing up properly in its Log Output file, but still not showing up in the same place on the standard TestNG report.
To unsubscribe from this group, send email to testng-users+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/testng-users?hl=en.

--
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+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages