This site is in read only mode. Please continue to browse, but replying, likes, and other actions are disabled for now.
1 / 7
Feb 2019

Hi All,

I’ve just got to a stage in automating my application that I would like to start generating reports on the tests I have run.

Where should I start? Looking for something simple but expandable to start with.

Thanks!

  • created

    Feb '19
  • last reply

    Feb '19
  • 6

    replies

  • 234

    views

  • 2

    users

  • 2

    links

@Venkatesh I’ve added those and got rid of the errors. Do I have to call each method in the Main class after each test or is there a way I can call it at the end of ALL my tests?

You don’t need to call this in main , implement and add it in your unit test as mentioned in testing examples on the same link.

TestNG Examples
Using ExtentTestNGReportBuilder

public class ExtentTestNGReportBuilder {

private static ExtentReports extent;
private static ThreadLocal parentTest = new ThreadLocal();
private static ThreadLocal test = new ThreadLocal();

@BeforeSuite
public void beforeSuite() {
	extent = ExtentManager.createInstance("extent.html");
	ExtentHtmlReporter htmlReporter = new ExtentHtmlReporter("extent.html");
	extent.attachReporter(htmlReporter);
}

@Venkatesh Is there any documentation to explain the code? Atm that always marks the test as a fail. How do I get it to mark it a pass or fail dependant on the test result. I can always make it pass or fail.