onTestSkipped and onTestFailure both are getting called

48 views
Skip to first unread message

Abhay

unread,
Jul 26, 2023, 5:37:18 AM7/26/23
to testng-users
I have written @BeforeClass method if beforeclass method fails all @test method from that class should skip with onTestSkipped. What is happening in reality, whenever onTestSkipped is called,  onTestFailure is also getting called. Any idea what is wrong with my code & how to stop it?

⇜Krishnan Mahadevan⇝

unread,
Jul 26, 2023, 9:24:04 AM7/26/23
to testng...@googlegroups.com
Hard to say without seeing your code and knowing what version of TestNG you are using, how you are running your tests etc.,

Feel free to share a sample project that can be used to reproduce the problem so that we can see what is going on.


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 Scribblings @ https://rationaleemotions.com/


On Wed, Jul 26, 2023 at 3:07 PM Abhay <abhay...@gmail.com> wrote:
I have written @BeforeClass method if beforeclass method fails all @test method from that class should skip with onTestSkipped. What is happening in reality, whenever onTestSkipped is called,  onTestFailure is also getting called. Any idea what is wrong with my code & how to stop it?

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/testng-users/245f154f-136e-4f12-99a1-88eb5104f3b7n%40googlegroups.com.

karun mehta

unread,
Jul 26, 2023, 9:24:08 AM7/26/23
to testng...@googlegroups.com
you may want to run the test with all pass first and see if the skip method is called successfully  and in second case you may call faill test test out side skip method 

let me know if that works for you

On Wed, Jul 26, 2023 at 05:37 Abhay <abhay...@gmail.com> wrote:
I have written @BeforeClass method if beforeclass method fails all @test method from that class should skip with onTestSkipped. What is happening in reality, whenever onTestSkipped is called,  onTestFailure is also getting called. Any idea what is wrong with my code & how to stop it?

--
Reply all
Reply to author
Forward
0 new messages