TestNG: Skip Test Case By Using enabled Tag

Use of enabled in TestNG:

By using enabled feature in TestNG , we can skip the test methods.
Some methods are continuously failing,due to those methods our test or execution stopped in between.To over come those problems we can use enabled feature.

Syntax:
@Test(enabled=true)  : Not skipped
@Test(enabled=false) : Test will be skipped

public class Skipfeature{
    @Test                          
    public void Enabled(){
        System.out.println("default enabled=true");
    }
    @Test(enabled=true)
    public void trueEnabled(){
        System.out.println("enabled=true");
    }
    @Test(enabled=false)
    public void falseEnabled(){
        System.out.println("test case will be skipped");
    }
}

Copyright © 2017 qatoolsguide.blogspot.com || ALL RIGHTS RESERVED