views:

165

answers:

1

Does anybody know what is called first if a test fails?

A: 

if you use the annotation @AfterMethod then The annotated method will be run after each test method. if u use the alwaysRun option with this then it will be run even if one or more methods invoked previously failed or was skipped.

for more info visit http://testng.org/doc/documentation-main.html

GK
As far i can tell, @AfterMethod is always run, no matter if you use @AfterMethod(alwaysRun=true) or not. What i *really* want to know is if i can savely assume that the sequence istest fails => ItestListener#onFailue(TestResult) => @AfterMethodortest fails => @AfterMethod => ItestListener#onFailue(TestResult)
sschuth