Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why can't I see exceptions thrown with TestNG?

I'm using TestNG with gradle:

compile group: 'org.testng',  name: 'testng', version: '6.11'

I'm using IntelliJ to run my tests. However, when one of my methods throws an exception, it doesn't show me what exception was thrown:

Failed test

The startDb method threw an exception, and was correctly marked as failed, but I can't find any way for me to actually see the exception that was thrown (without wrapping the method in a try-catch).

Method:

StartDb Method

The specific method doesn't show anything either:

Specific method results

Is this supposed to be occurring? How am I supposed to debug why tests are failing if I don't get any information from TestNG?

like image 720
Nathan Merrill Avatar asked Oct 28 '25 06:10

Nathan Merrill


1 Answers

Apparently, TestNG doesn't show output unless the following is set in gradle:

test {
    testLogging.showStandardStreams = true
}
like image 129
Nathan Merrill Avatar answered Oct 29 '25 22:10

Nathan Merrill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!