Is this possible to exclude classes in testng.xml?
I tried with
<packages>
<package exclude="com.tt.ee"/>
</packages>
but it's giving error.
Is this possible to exclude classes in testng.xml?
I tried with
<packages>
<package exclude="com.tt.ee"/>
</packages>
but it's giving error.
As workaround, you can add pseudo groups to the each test with name, equals test method or test class via annotation transformer
}
and use it in your testng.xml
You could use classfilesetref and define the list of classes you want to run.
There is no direct way to skip test class though testng.xml. However there are workaround which can used to ignore particular test class.
The same topic discussed in testng-user group but no direct answer refer the mail thread - Re: [testng-users] Ignore a class in testng
It works like this:
In the
name
attributes, provide the package names.Note: In TestNG 6.14.3, you cannot exclude classes in the
<classes>
XML tag.Add
(groups = { "anyName"})
right after tests you don't want to run, so it will be look like:And than in your xml file add just after
test name="..."
Methods with
(groups = { "group1"})
wont be runned. This way works for me. Remember that you can't exclude Class, only package, methods and runs. Good luckI had the same issue ! Anyway, the solution i found is using the tag classes instead of packages this is my testng.xml file :
in this case, only the class BrmsServicesFactoryTest tests are executed, the other class tests not executed !
I hope this could help you !