I'm writing test cases using TestNG.I want run a particular method after every failure test case.is there any way to run that method after every failure case?
You can use ITestListener interface when you want to run a particular method after your test case failure.
You can find the ITestListener doc here: http://static.javadoc.io/org.testng/testng/6.11/org/testng/ITestListener.html
And you can refer to the following link for its implementation, its very helpful !! https://www.toolsqa.com/selenium-webdriver/testng-listeners/