com.relevantcodes.extentreports.utils.ExceptionUtil Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of extentreports Show documentation
Show all versions of extentreports Show documentation
ExtentReports is an open-source reporting library for test automation. It is very easily integrated with all test-frameworks (TestNG, JUnit, NUnit etc.) and provides better looking reports. Because Extent is created as a logging utility, it is also possible to use custom logs for each test, add snapshots & videos, assign categories and authors and filter using several parameters.
package com.relevantcodes.extentreports.utils;
import java.io.PrintWriter;
import java.io.StringWriter;
public class ExceptionUtil {
public static String getStackTrace(Throwable t) {
StringWriter sw = new StringWriter();
PrintWriter pw = new PrintWriter(sw);
t.printStackTrace(pw);
return sw.toString();
}
}