Next-Gen App & Browser Testing Cloud
Trusted by 2 Mn+ QAs & Devs to accelerate their release cycles

To create a test suite in Eclipse, right-click the package that contains your test classes, choose New > Other > JUnit > JUnit Test Suite, tick the classes you want to include, and click Finish. Eclipse generates a suite class annotated with @RunWith(Suite.class) and @Suite.SuiteClasses, which runs every listed test together when you select Run As > JUnit Test. If you use TestNG instead, you define the suite in a testng.xml file and run it as a TestNG Suite.
A test suite groups related tests so they execute as one unit, which keeps regression runs organized and repeatable. Below are the JUnit 4, JUnit 5, and TestNG approaches, plus how to scale a suite across real browsers.
A test suite is a collection of test cases grouped together and executed as a single run. Instead of launching each test class by hand, you point Eclipse at the suite and it runs everything in order, aggregating the results in one view. Suites make it easy to organize tests by feature, layer, or priority, and they are the unit you typically wire into a CI pipeline. Learn more in the TestMu AI test suite learning hub.
For JUnit 4, the generated suite uses annotations to list its member classes:
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses({
LoginTest.class,
CheckoutTest.class,
SearchTest.class
})
public class AllTests {
// Empty holder. JUnit runs every class listed above.
}JUnit 5 replaces the old runner with the JUnit Platform Suite engine. Add the junit-platform-suite dependency, then annotate a class with @Suite and select tests by package or class:
import org.junit.platform.suite.api.SelectClasses;
import org.junit.platform.suite.api.Suite;
@Suite
@SelectClasses({ LoginTest.class, CheckoutTest.class, SearchTest.class })
public class AllTests {
}TestNG does not define suites in code. Instead, right-click the project, add a file named testng.xml, and describe the suite hierarchy of suite, test, and classes. You can also enable parallel execution right in the suite tag, then run it via Run As > TestNG Suite:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd">
<suite name="RegressionSuite" parallel="tests" thread-count="3">
<test name="LoginTests">
<classes>
<class name="com.example.LoginTest"/>
</classes>
</test>
<test name="CheckoutTests">
<classes>
<class name="com.example.CheckoutTest"/>
</classes>
</test>
</suite>For a detailed walkthrough, see the TestMu AI guide on creating a TestNG XML file for parallel testing and the JUnit tutorial.
A suite that runs on your local machine still only covers one browser and one OS. By pointing the same JUnit or TestNG suite at a Selenium cloud grid through RemoteWebDriver, you keep all your Eclipse setup but execute every test on remote infrastructure. On TestMu AI, that suite can run cross-browser testing across 3000+ real browsers and devices in parallel, so a single Run command validates Chrome, Firefox, Safari, and Edge at once instead of one configuration at a time. Combined with TestNG parallel execution, this cuts a long regression suite from hours to minutes.
Creating a test suite in Eclipse comes down to your framework: JUnit 4 uses @RunWith(Suite.class) with @Suite.SuiteClasses, JUnit 5 uses the Platform @Suite engine, and TestNG uses a testng.xml file with suite, test, and class tags. Pick the approach that matches your project, keep the suite in the source folder, and run it with a single command. To turn that one-machine suite into full cross-browser coverage, execute it on a real-device cloud grid.
A test suite is a container that groups related test classes so they run together as one unit. In Eclipse you build it with a JUnit suite class (using @RunWith and @Suite) or a TestNG XML file, then execute every included test with a single Run command.
Right-click the package that holds your test classes, choose New > Other > JUnit > JUnit Test Suite, select the classes to include, and click Finish. Eclipse generates a suite class annotated with @RunWith(Suite.class) and @Suite.SuiteClasses that you run as a JUnit Test.
JUnit defines suites in a Java class with annotations, while TestNG defines them in an XML file. The testng.xml file lists suite, test, and class tags and supports parallel execution, groups, and parameters, which the annotation-based JUnit suite does not offer out of the box.
The JUnit Test Suite wizard only lists classes it recognizes as test classes. If your tests are not compiled, are missing @Test methods, or JUnit is not on the build path, the wizard shows nothing to add. Fix the build path and rebuild, then rerun the wizard.
TestNG supports it directly by adding parallel and a thread-count to the suite tag, for example parallel set to tests or classes. For true scale, point the suite at a cloud Selenium grid so the same tests run across many browsers and devices at once.
Use RemoteWebDriver with cloud grid capabilities instead of a local driver. Your existing JUnit or TestNG suite runs unchanged, but each test executes on a remote browser and OS combination, letting you validate Chrome, Firefox, Safari, and Edge from the same suite.
KaneAI - Testing Assistant
World’s first AI-Native E2E testing agent.

TestMu AI forEnterprise
Get access to solutions built on Enterprise
grade security, privacy, & compliance