question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Reporter output doesn't output anything even if we have data in reporter-output.html file

See original GitHub issue

TestNG Version : 6.8.7 (reproducible in 6.9.8 also) useDefaultListeners : true (use default listeners) One of which is org.testng.reporters.jq.Main

Now log anything from test cases using Reporter.log. For reproduction, I used 2 test cases with retry mechanism in place using IRetryAnalyzer.

I am failing both the tests intentionally. When I see the reports, in target/surefire-reports/index.html (produced by org.testng.reporters.jq.Main) doesn’t show anything in Reporter output section, sometimes it shows entry for one test case and not for the other. While data is always there in target/surefire-reports/old/<suite_name>/reporter-output.html.

While debugging, I found when we create report in org.testng.reporters.jq.Main class. It goes to following method in ReporterPanel to get data from Reporter:

public String getContent(ISuite suite, XMLStringBuffer main) {
    XMLStringBuffer xsb = new XMLStringBuffer(main.getCurrentIndent());
    for (ITestResult tr : getModel().getAllTestResults(suite)) {
      List<String> lines = Reporter.getOutput(tr);
      if (! lines.isEmpty()) {
        xsb.push(D, C, "reporter-method-div");
        xsb.addRequired(S, Model.getTestResultName(tr), C, "reporter-method-name");
        xsb.push(D, C, "reporter-method-output-div");
        for (String output : lines) {
          xsb.addRequired(S, output, C, "reporter-method-output");
        }
        xsb.pop(D);
        xsb.pop(D);
      }
    }
    return xsb.toXML();
  }

In this, Reporter is coming as null, due to which it doesn’t get any data. I also tried to disable all reporters except this to give it first chance to access Reporter, but no luck.

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
satish88commented, Jun 15, 2016

Working on creating a sample

0reactions
juherrcommented, Jun 17, 2016

Could you try with 6.9.10 (latest on maven central) or later (available on bintray) ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

protractor-jasmine2-html-reporter doesn't consolidate results ...
The limitation is with the 'Jasmine2HtmlReporter' as it overwrites the html report file when tests run in parallel.
Read more >
HTML tags in console output using Reporter.log
1). I am having a problem formatting the output using Reporter.log. The output in the generated detailed report looks fine. Please see the...
Read more >
newman-reporter-htmlextra - npm
Specify a path where the output HTML file will be written to disk. If not specified, the file will be written to newman/...
Read more >
dotnet test command - .NET CLI | Microsoft Learn
NET Core 3.0 SDK. --no-restore. Doesn't execute an implicit restore when running the command. -o|--output ...
Read more >
Reporters - CodeceptJS
after (I am on page "https://github.com") Emitted | test.start ([object Object]) ... Please use verbose output when reporting ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found