Next-Gen App & Browser
Testing Cloud

Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

Next-Gen App & Browser Testing Cloud

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.

Test your website on 3000+ browsers

Get 100 minutes of automation test minutes FREE!!

Test Now...

KaneAI - Testing Assistant

World’s first AI-Native E2E testing agent.

...
ShadowLT Logo

Start your journey with LambdaTest

Get 100 minutes of automation test minutes FREE!!

Signup for free