How to skip a method or a code block in TestNG?

If you want to skip a particular test method, then you can set the "enabled" parameter in test annotation to false.

By default, the value of "enabled" parameter will be true. Hence it is not necessary to define the annotation as true while defining it.


@Test(enabled = false)
public myMethod()