All tests are being excluded when using groups in Testng XML suite -


When I try to group my tests in the Testng XML suite, all test methods are included in the test run goes.

I have written my tests in a way that I want to run all the test methods in my class, but the suite has to execute only a few sections, so I use class-level comments Exceptions: { Public Zero Test 1 ()) Exception @Test Public Zero Test 2 (Exceptions):

  @Test (group = {TestConstrants.Group1}) ) Throws exceptions } @Test (groups = {TestConstrants.Group2}) Public class DEFTests up to AbstractIntegrationTest {+ Test Public Zero Test 3 () throws an exception exception @Test Public Zero Test 4 () throws exceptions}   < P> My Testng XML is configured for:  
  & lt ;? XML version = "1.0" encoding = "UTF-8"? & Gt; & Lt ;! DOCTYPE Suite System "http://testng.org/testng-1.0.dtd"> & Lt; Suite Name = "Suit Group" & gt; & Lt; Test name = "TestGroups" preserve-order = "true" & gt; & Lt; Groups & gt; & Lt; Run & gt; & Lt; Include name = "TestConstants.Group1" /> & Lt; Leave Name = "TestConstants.Group2" /> & Lt; / Run & gt; & Lt; / Groups & gt; & Lt; Classes & gt; & Lt; Class name = "ABCTests" /> & Lt; Class name = "DEFTests" /> & Lt; / Sections & gt; & Lt; / Test & gt; & Lt ;! - Test group - & gt; & Lt; / Suits & gt; & Lt ;! - Group group - & gt;   

In this example, I expect that only test should be run in class ABCTests, however, it appears that all tests are being excluded for some reasons. I have verified that the class I am expanding (abstract detective) has been set to 'always start' = '.

I know that I can not include classes that I do not want to run, but I can potentially do hundreds of tests and it is very easy to maintain the test suite by group from the group. Any help is greatly appreciated.

If you can create a small project that shows the problem, then email me and I will take a look .

Note: You are using the word "constrants" in the snippet above, not sure whether this is your real code or there is no harmless typo here.

Comments