Java Test Automation / Quiz
Groups & testng.xml: Slicing the Suite
smoke vs regression, include vs exclude, <parameter> injection, the suite file that decides what actually runs tonight.
- Difficulty
- Medium
- Format
- Quiz
- Points
- 150
- Estimate
- 9 min
// MISSION BRIEF
Your Mission
One codebase, many runs: the 4-minute smoke on every PR, the full regression at night, the payments-only slice before a gateway change. In TestNG that slicing is groups plus testng.xml.
This quiz covers group mechanics, include/exclude semantics, the suite file's structure, and parameter injection with @Parameters.
// FIRST CONTACT
Battle teaser
Tests are tagged @Test(groups = {"smoke"}). How do you run ONLY the smoke group via testng.xml?
- ARename all smoke classes to Smoke*.java
- B<suite name="smoke"> is enough, the suite name selects the group
- CInside the <test> tag: <groups><run><include name="smoke"/></run></groups>
- DGroups can only be selected from the command line
Answers, scoring, hints, and the full battle stay sealed.
// SKILL TAGS
javatestnggroupstestng-xml