Some times a failing test causes the build to fail. In that cases before the test is fixed a quick remedy is to disable the test to get the build passed. That can be done easily through annotation.
@Test(enabled=false)
The TestNG engine will just bypass this method.
import org.testng.annotations.*; public class TestNGTest3 { @Test(enabled=false) public void divisionWithException() { System.out.println("Method is not ready yet"); } }
In above example, TestNG will not test the divisionWithException() method.
A better way is to put your test method in a group, say “broken”, and exclude that group from your runs. The advantage of this approach is that you can use the reports to find out all the methods that are part of the “broken” group to keep track of them.
LikeLike