Declare a parameter of type ITestResult in your @AfterMethod and TestNG will inject it:
@AfterMethod
public void afterMethod(ITestResult result) {
System.out.println("method name:" + result.getMethod().getMethodName());
}
Declare a parameter of type ITestResult in your @AfterMethod and TestNG will inject it:
@AfterMethod
public void afterMethod(ITestResult result) {
System.out.println("method name:" + result.getMethod().getMethodName());
}