Continuous Test Orchestration And Execution Platform Online

Perform automated and live-interactive testing on 3000+ real desktop and mobile devices online.

What is test suite in TestNG?

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.

AttributeDescription
nameThe name of the test suite.
verboseThe level of verbosity for test execution.
parallelThe way tests should be run. Possible values are "classes", "methods", "tests" and "instances".
thread-countThe number of threads to use when running tests in parallel.
config-failure-policyWhat TestNG should do if a configuration failure is encountered. Possible values are "skip" and "continue".
data-provider-thread-countThe 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.

LambdaTest

Test your websites, web-apps, or mobile apps seamlessly with LambdaTest.

Start Free Testing
LambdaTest

Earn resume-worthy Selenium certifications that help you land a top job.

Learn More
LambdaTest

Test your web or mobile apps

Test orchestration and execution cloud of 3000+ browsers and OS

Support

24/7 support

Security

Enterprise grade security

Cloud

Fastest test execution cloud