test results/report in console output

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

test results/report in console output

Todd Bradley
Hi, I'm instantiating a TestNG instance in a Java application, and running tests. I'd like some simple console (stdout) output at the end of the test to tell me basic details of assertions that failed. But all the examples I'm finding online show how to create your own class to get information from the TestListenerAdapter. I'm hoping something already exists for what I want. I don't need an HTML report, just something simple in ASCII text. Here's my code to help explain:

TestNG testNG = new TestNG();
Class[] classes = {MyTest.class};
testNG.setTestClasses(classes);
TestListenerAdapter tla = new TestListenerAdapter(); 
testNG.addListener(tla);
testNG.run();
// I want to call something here to print out a summary of the test run - passes/fails/skips, failed assertions, etc.


Thanks,
Todd.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: test results/report in console output

Krishnan Mahadevan

Todd,

 

If you set your verbosity level to “2” or higher [ your current test code doesn’t set any verbosity levels], then you should see the default reporter org.testng.reporters.TextReporter provide you with some basic information such as what you are looking for.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply-To: <[hidden email]>
Date: Friday, March 30, 2018 at 8:30 PM
To: testng-users <[hidden email]>
Subject: [testng-users] test results/report in console output

 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To post to this group, send email to
[hidden email].
Visit this group at
https://groups.google.com/group/testng-users.
For more options, visit
https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: test results/report in console output

Todd Bradley-2
Thank you very much, Krishnan. Doing this worked perfectly:

testNG.addListener((ITestNGListener) new TextReporter(myName.getName(), 2));



On Fri, Mar 30, 2018 at 11:27 AM, Krishnan Mahadevan <[hidden email]> wrote:

Todd,

 

If you set your verbosity level to “2” or higher [ your current test code doesn’t set any verbosity levels], then you should see the default reporter org.testng.reporters.TextReporter provide you with some basic information such as what you are looking for.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

Reply-To: <[hidden email]>
Date: Friday, March 30, 2018 at 8:30 PM
To: testng-users <[hidden email]>
Subject: [testng-users] test results/report in console output

 

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
[hidden email].
To post to this group, send email to
[hidden email].
Visit this group at
https://groups.google.com/group/testng-users.
For more options, visit
https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "testng-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.