0
0
Selenium Javatesting~5 mins

Test groups in Selenium Java - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
Acategory
Bpriority
Csuite
Dgroups
How do you run only the 'smoke' test group using a TestNG XML file?
AInclude <groups><run><include name="smoke"/></run></groups>
BSet <suite name="smoke"/>
CAdd <test name="smoke"/>
DUse <parameter name="group" value="smoke"/>
What happens if you exclude a group in TestNG XML?
ATests in that group run only if others fail
BTests in that group will not run
CTests in that group run first
DTests in that group run twice
Can test groups help reduce test execution time?
AYes, by running only selected groups
BNo, all tests run anyway
COnly if tests are parallel
DOnly for UI tests
Which of these is NOT a valid reason to use test groups?
ARun smoke tests separately
BOrganize tests by feature
CRun tests by priority automatically
DExclude flaky tests temporarily
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.