Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9014907
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:37:30+00:00 2026-06-16T03:37:30+00:00

There are some test classes which needs to be ignored when I run my

  • 0

There are some test classes which needs to be ignored when I run my testng suite. I tried using the @Test(enabled=false) annotation for the class and methods that needs to be ignored. But my problem is that the class that needs to be ignored extends an abstract class and this abstract class test methods are not ignored even when I have @Test(enabled=false) annotation on the base class. In Junit I could use @ignore on the base class and the test methods on the extended class would not be invoked at all. How can I replicate this behaviour in testng.

Also In my testng suite I run the test by packages and not by classes. Hence even if I try to group the class and ignore the group it is not working either.
<test name="Test">
<groups>
<run>
<exclude name="testClass"/>
</run>
</groups>
<packages>

Please help

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:37:31+00:00Added an answer on June 16, 2026 at 3:37 am

    I received a response from Cedric on this from the google groups(Testng) . I am pasting it below for reference

    Hi Paul,

    What you are seeing is an unfortunate consequence of the way inheritance of annotations and default attributes interact with each other in TestNG, and a bug has been filed to make it work better (I don’t have the id handy).

    Consider:

    @Test(enabled = false)
    public class C {
      @Test
      public void f()
    }
    

    When TestNG resolves these annotations, it finds that the @Test on the method doesn’t specify “enabled”, so it assigns it its default value. The example becomes:

    @Test(enabled = false)
    public class C {
      @Test(enabled = true)
      public void f()
    }
    

    And now, the value defined at the method level overrides the one specified on the class.

    The fix would involve using an enum instead of a boolean (ENABLED, DISABLED, INHERITED, which would be the default), but this would break backward compatibility, so I would need to introduce a new annotation for this (e.g. “runStatus” or something like that), and your example would become

    @Test(runStatus = DISABLED)
    public class C {
      @Test
      public void f()
    }
    

    Does this make sense?

    —
    Cédric

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the Silverlight Unit Testing Framework to test some View Manager classes.
Basically, we want to A/B test 2 different page layout headers. There are some
Say there are multiple requests in a integration test, some of them are local
I want to test the phpDocumentor-alpha, and there's a problem that some people seems
I've had a test, and there was a question I lost some points on,
I'm using Google Test Framework to set some unit tests. I have got three
Are there some good resources tutorials or anyone has tried to implement a Capcha
I have some test case classes organized in directories foo_tests foo_tests1.py foo_tests2.py ... bar_tests
I need to test some security related classes that depend on Spring Security. This
I have a java package which contains all my test case classes. Each class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.