TestNG @Test attributes – enabled property

There are situations where we need to skip one or more @Test method in testNG,
for this TestNG provides enabled property to skip the execution of methods…

enabled = false (skip the method run)
enabled = true (execute method), it’s by default set to true,

NOTE: if we do not mention enabled property, it’s set to true

Let’s see the code implementation


Even though test4() does not have enabled property, it’s default set to true.

skipped test method – test2() …

Content posted is based on learning or working experience,
Share the post with others if find useful,
Any queries?, leave comments or discuss on our facebook:qavalidation.com, Thanks!

Leave a Reply

Your email address will not be published. Required fields are marked *