Recall & Review
beginner
What is the purpose of test groups in Selenium with Java?
Test groups help organize tests into categories so you can run specific sets of tests together, like running only smoke tests or regression tests.
Click to reveal answer
beginner
How do you define a test group in TestNG for Selenium Java?
You add the
groups attribute in the @Test annotation, like @Test(groups = {"smoke"}) to assign a test to the 'smoke' group.Click to reveal answer
intermediate
How can you run only a specific test group using TestNG?
You specify the group name in the TestNG XML file under the
<groups> section or use command line options to include or exclude groups.Click to reveal answer
intermediate
What is the benefit of using test groups in large Selenium test suites?
Test groups let you run smaller, focused sets of tests quickly, like running only critical tests before a release, saving time and resources.Click to reveal answer
beginner
Can a single test belong to multiple groups in TestNG? How?
Yes, by listing multiple group names in the
groups attribute, like @Test(groups = {"smoke", "regression"}).Click to reveal answer
Which annotation attribute is used to assign a test to a group in TestNG?
✗ Incorrect
The
groups attribute in the @Test annotation assigns tests to groups.How do you run only the 'smoke' test group using a TestNG XML file?
✗ Incorrect
You include the group name inside in the TestNG XML.
What happens if you exclude a group in TestNG XML?
✗ Incorrect
Excluding a group means tests in that group are skipped during the test run.
Can test groups help reduce test execution time?
✗ Incorrect
Running specific groups lets you run fewer tests, saving time.
Which of these is NOT a valid reason to use test groups?
✗ Incorrect
Test groups organize tests but do not automatically run tests by priority.
Explain how test groups work in Selenium with TestNG and why they are useful.
Think about organizing tests like sorting clothes into categories before washing.
You got /4 concepts.
Describe the steps to run only a specific test group using TestNG XML configuration.
It's like telling a playlist to play only your favorite songs.
You got /4 concepts.