Reporter class in testng

In TestNG framework, we have a class called as org.testng.Reporter. This class can be used to send custom logs to TestNG HTML report. As shown in below example, you can use static methods to dump data in report. In below example, we have used log method of Reporter class.
 
@Test(dependsOnMethods = "org.softpost.Class2.test1")
public void test1(){
    System.out.println("Test1 from Class1");
    Reporter.log("This will be displayed in report");
    Assert.assertTrue(2==3);
}

Here is the HTML report showing the log. Reporter output in TestNG Reporter output in TestNG

Web development and Automation testing

solutions delivered!!