Is there a way to suppress the java.lang.AssertionError stack trace that appears in the console when an exception is thrown? It doesn't provide much useful info (i.e. expected [true[ but found ]false]) and it would be nice to have the option to get rid of it, so it doesn't clutter other output. thanks -dan
import org.testng.ITestResult;
import org.testng.TestListenerAdapter;
public class NoTrace extends TestListenerAdapter {
@Override
public void onTestFailure(ITestResult tr)
{
Throwable thrown = tr.getThrowable();
StackTraceElement[] outTrace = new StackTraceElement[0];
thrown.setStackTrace(outTrace);
}
@Override
public void onTestSkipped(ITestResult tr)
{
}
@Override
public void onTestSuccess(ITestResult tr)
{
}
}