1

I have a test suite called Test.XML. If I want to exclude any one class, how can I do that?

Here is the Test.XML:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 
<suite name="TestAll">
 
    <test name="test1">
        <classes>
            <class name="test.LoginOneReports" />
        </classes>
    </test>
    <test name="test2">
        <classes>
            <class name="test.OEPR_DefaultTab" />
        </classes>
    </test>
    <test name="test3">
        <classes>
            <class name="test.OEPR_InternalvsExternalTab" />
        </classes>
    </test>
</suite>
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
testing
  • 1,736
  • 15
  • 46
  • 75

2 Answers2

0

You can't explicitly exclude classes in TestNG.xml. Please refer to more detailed answer for question How to exclude class in TestNG.

Community
  • 1
  • 1
artdanil
  • 4,952
  • 2
  • 32
  • 49
0

Mention all the class names inside <classes> including the ones that should not be run. And, inside the class that should be excluded, use and <exclude name =.* />. It will exclude all the tests from this class and run all the other classes.