Next-Gen App & Browser
Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles
In TestNG, a test suite is defined using the suiteXmlFile attribute of the <suite> element in the TestNG configuration file. This attribute specifies the name and location of the XML file that defines the test suite, which includes a list of the test cases that are part of the suite. When TestNG is run, it will execute all of the test cases that are included in the specified test suite.
In TestNG, we cannot define a suite in testing source code, but it is represented by one XML file, as suite is the feature of execution. It also allows flexible configuration of the tests to be run.
A suite can contain one or more tests and is defined by the <suite> tag. <suite> is the root tag of your testng.xml. It describes a test suite, which in turn is made of several <test> sections.
The following table lists all the legal attributes that <suite> accepts.
Attribute | Description |
---|---|
name | The name of the test suite. |
verbose | The level of verbosity for test execution. |
parallel | The way tests should be run. Possible values are "classes", "methods", "tests" and "instances". |
thread-count | The number of threads to use when running tests in parallel. |
config-failure-policy | What TestNG should do if a configuration failure is encountered. Possible values are "skip" and "continue". |
data-provider-thread-count | The number of threads to use when running data-provider methods in parallel. |
For a step-by-step guide, refer to our tutorial on test suite.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.