alwaysRun annotation : Lets explain alwaysRun with an example
import org.testng.annotations.*;
/**
* TestNG always run
* @author himanshu bisht
*
*/
public class ExampleTestNGT {
@Test
public void methodfail() {
System.out.println("Fail Method");
}
@Test(dependsOnMethods={"methodfail"}, alwaysRun=true)
public void alwaysruntrue() {
System.out.println("Always run is true");
}
}
In this case alwaysRuntrue method will always run even if methodfail is pass or fail