SELENIUM BASICS:


SELENIUM WEBDRIVER:


TESTNG:


REPORTS:


BUILD & CONTINUOUS INTEGRATION TOOLS:


CROSS BROWSER TESTING:


MOBILE TESTING:


AUTOMATION FRAMEWORKS:


API Testing:


INTERVIEW QUESTIONS:


SAMPLE RESUME:

How To Ignore TestNG Test | TestNG Tutorial

At times we may face some situations where our code is not ready and the test cases written to test a particular method may fail. In such cases, we could use TestNG annotation @Test(enabled = false). This TestNG annotation allows us to ignore testng test.

If a test method is annotated with @Test(enabled = false), then the test case that is not ready to test is ignored.

Now, let’s see how to ignore TestNG test using a script.

Script – Test Case 1:

Script – Test Case 2: I would like to ignore this test from the test execution

testNg.xml file:

Check below video to see how to create and run testng.xml

Please be patient. The video will load in some time.

If you liked this video, then please subscribe to our YouTube Channel for more video tutorials.

Console Output:

 

You could find the complete TestNG tutorial here.

TestNG Complete Tutorial

If you are not regular reader of my blog then I highly recommend you to signup for the free email newsletter using the below link.

Sharing is caring.

Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Get our latest blog posts delivered to your inbox

Subscribe and get popular blog posts about software testing industry.

Rajkumar

2 thoughts on “How To Ignore TestNG Test | TestNG Tutorial”

  1. Hi Raj,

    what is difference between ignoring(enable=false) the TC and skipping(throw new Skipexeption TC? Both serve same purpose rt to not to execute particular TC. In the interview if they How to skip the TC then do we need to tell both the options?

    Thank you

    • Hi Deepa,
      ‘@Test(enabled = false)’ is used to bypass the test which is not ready to test.
      ‘throw new SkipException’ is used to throw an exception to skip some condition.

Leave a Comment