Appendix C. testng.xml

testng.xml is an XML file that describes the runtime definition of a test suite. While its syntax is fairly simple (the DTD is less than 150 lines, most of them comments), it can describe complex test definitions while still remaining legible and easy to edit. In this appendix, we’ll examine the structure of this file in detail, and we’ll show how changing certain parameters affects how tests are run.

TestNG enforces a strict separation between the static model (the business logic of your tests) and its runtime (which tests get run). For example, you should be able to run front-end tests and then back-end tests without having to recompile anything in the code base in between.

TestNG offers the following mechanisms to enforce ...

Get Next Generation Java™ Testing: TestNG and Advanced Concepts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.