Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.
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.
Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.
Start Free TestingEarn resume-worthy Selenium certifications that help you land a top job.
Learn MoreTest orchestration and execution cloud of 3000+ browsers and OS
24/7 support
Enterprise grade security
Fastest test execution cloud