How to get the reason for Skipped Test cases in TestNG

3,402 views
Skip to first unread message

Raju Arelli

unread,
Nov 23, 2016, 8:10:45 AM11/23/16
to testng-users
I have around 100 test cases in my Test suite.
When I run the suite,few of the test cases are getting skipped without any reason.I couldn't able to find the log for skipping.
When I run the same test cases individually,those are running perfect.

Could somebody assist on this.

Thanks,
Raju


⇜Krishnan Mahadevan⇝

unread,
Nov 23, 2016, 10:19:15 AM11/23/16
to testng...@googlegroups.com
Raju,

AFAIK, TestNG already adds the details about why a Test method was skipped which can be queried by invoking  ITestResult#getThrowable() [ Here ITestResult is the test result object of a test method that was skipped ]

But if a test method gets skipped due to a configuration failure, then this information is currently not available.

That being said, as part of this commit  I have enhanced TestNG to start including this data even for test methods that were skipped due to a configuration failure. So this will be available in the upcoming TestNG version [ I don't know the timelines for when the next version of TestNG is going to be available though ]


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/

--
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 testng-users+unsubscribe@googlegroups.com.
To post to this group, send email to testng...@googlegroups.com.
Visit this group at https://groups.google.com/group/testng-users.
For more options, visit https://groups.google.com/d/optout.

Raju Arelli

unread,
Nov 23, 2016, 9:54:17 PM11/23/16
to testng...@googlegroups.com
HI Krishnan,
Thanks for the update.
How can we get to know whether the skipping is due to configuration failure or normal failure?
Do i need to implement ITestResult interface for that ?

Thanks
Raju

⇜Krishnan Mahadevan⇝

unread,
Nov 23, 2016, 10:06:25 PM11/23/16
to testng...@googlegroups.com
No. You don't need to implement anything.
You just build a TestNG listener based on org.testng.ITestListener wherein you will get notified of the test method's ITestResult and from within that you can query the throwable to find out the reason.

Refer to the below links for more information:

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/

On Thu, Nov 24, 2016 at 8:24 AM, Raju Arelli <raja...@gmail.com> wrote:
HI Krishnan,
Thanks for the update.
How can we get to know whether the skipping is due to configuration failure or normal failure?
Do i need to implement ITestResult interface for that ?

Thanks
Raju

Raju Arelli

unread,
Nov 30, 2016, 2:12:46 AM11/30/16
to testng-users
Hi Krishnan,

Is there any chance to avoid Configuration Skipping in TestNG atleast?


On Thursday, November 24, 2016 at 8:36:25 AM UTC+5:30, Krishnan wrote:
No. You don't need to implement anything.
You just build a TestNG listener based on org.testng.ITestListener wherein you will get notified of the test method's ITestResult and from within that you can query the throwable to find out the reason.

Refer to the below links for more information:

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/

On Thu, Nov 24, 2016 at 8:24 AM, Raju Arelli <raja...@gmail.com> wrote:
HI Krishnan,
Thanks for the update.
How can we get to know whether the skipping is due to configuration failure or normal failure?
Do i need to implement ITestResult interface for that ?

Thanks
Raju
On Wed, Nov 23, 2016 at 8:49 PM, ⇜Krishnan Mahadevan⇝ <krishnan.ma...@gmail.com> wrote:
Raju,

AFAIK, TestNG already adds the details about why a Test method was skipped which can be queried by invoking  ITestResult#getThrowable() [ Here ITestResult is the test result object of a test method that was skipped ]

But if a test method gets skipped due to a configuration failure, then this information is currently not available.

That being said, as part of this commit  I have enhanced TestNG to start including this data even for test methods that were skipped due to a configuration failure. So this will be available in the upcoming TestNG version [ I don't know the timelines for when the next version of TestNG is going to be available though ]


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/
On Wed, Nov 23, 2016 at 6:40 PM, Raju Arelli <raja...@gmail.com> wrote:
I have around 100 test cases in my Test suite.
When I run the suite,few of the test cases are getting skipped without any reason.I couldn't able to find the log for skipping.
When I run the same test cases individually,those are running perfect.

Could somebody assist on this.

Thanks,
Raju


--
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 testng-users...@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
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 testng-users...@googlegroups.com.

To post to this group, send email to testng...@googlegroups.com.
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 testng-users...@googlegroups.com.

⇜Krishnan Mahadevan⇝

unread,
Nov 30, 2016, 2:24:56 AM11/30/16
to testng...@googlegroups.com
Maybe you could set the attribute "always-run=true" for the config annotations and see if that's what you need.

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/

To unsubscribe from this group and stop receiving emails from it, send an email to testng-users+unsubscribe@googlegroups.com.

Raju Arelli

unread,
Mar 2, 2017, 8:41:05 AM3/2/17
to testng...@googlegroups.com
Hi Krishnan,

As the TestNG 6.9.11 is released, can you confirm whether the fix you provided to get the reason for configuration failure ?

Thanks,
Raju

⇜Krishnan Mahadevan⇝

unread,
Mar 2, 2017, 1:02:49 PM3/2/17
to testng...@googlegroups.com
The last released version of TestNG is 6.10 (TestNG 6.11 is being released, but I am not sure if its hit Maven central yet).

TestNG 6.10 should have my fix. Have you tried ? If yes does it not work ?

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 all
Reply to author
Forward
0 new messages