Basically, I have a teardown method that I want to log to the console which test was just run. How would I go about getting that string?
I can get the class name, bu
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()); }